Skip to content

Commit

Permalink
And a test for the force variant theme
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Sep 3, 2023
1 parent 1c741ce commit 6b2b8a2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cmd/fyne_demo/theme_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package main

import (
"testing"

"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
"github.com/stretchr/testify/assert"
)

func TestForceVariantTheme_Color(t *testing.T) {
dark := &forceVariantTheme{Theme: theme.DefaultTheme(), variant: theme.VariantDark}
light := &forceVariantTheme{Theme: theme.DefaultTheme(), variant: theme.VariantLight}
unspecified := fyne.ThemeVariant(99)

assert.Equal(t, theme.DefaultTheme().Color(theme.ColorNameForeground, theme.VariantDark), dark.Color(theme.ColorNameForeground, unspecified))
assert.Equal(t, theme.DefaultTheme().Color(theme.ColorNameForeground, theme.VariantLight), light.Color(theme.ColorNameForeground, unspecified))
}

0 comments on commit 6b2b8a2

Please sign in to comment.