25 lines
572 B
Go
25 lines
572 B
Go
package data
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/egoist/mygo/ui"
|
|
|
|
"git.zacharyzhang.com/ZacharyZhang-NY/MujicaUI/core"
|
|
"git.zacharyzhang.com/ZacharyZhang-NY/MujicaUI/internal/snaptest"
|
|
)
|
|
|
|
// snapshot compares view in both themes with testdata/snapshots/<os>/<name>-<mode>.png.
|
|
func snapshot(t *testing.T, name string, w, h int, view func(c *ui.Context)) {
|
|
t.Helper()
|
|
snaptest.Run(t, name, w, h, snapshotTheme, view, nil)
|
|
}
|
|
|
|
func snapshotTheme(c *ui.Context, mode string) {
|
|
m := core.Light
|
|
if mode == "dark" {
|
|
m = core.Dark
|
|
}
|
|
core.Use(c, core.Settings{Mode: m})
|
|
}
|