mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 20:52:33 +02:00
36 lines
688 B
Go
36 lines
688 B
Go
package homepage
|
|
|
|
import (
|
|
"testing"
|
|
|
|
expect "github.com/yusing/go-proxy/internal/utils/testing"
|
|
)
|
|
|
|
func TestOverrideItem(t *testing.T) {
|
|
InitOverridesConfig()
|
|
a := &Item{
|
|
Alias: "foo",
|
|
ItemConfig: &ItemConfig{
|
|
Show: false,
|
|
Name: "Foo",
|
|
Icon: &IconURL{
|
|
Value: "/favicon.ico",
|
|
IconSource: IconSourceRelative,
|
|
},
|
|
Category: "App",
|
|
},
|
|
}
|
|
want := &ItemConfig{
|
|
Show: true,
|
|
Name: "Bar",
|
|
Category: "Test",
|
|
Icon: &IconURL{
|
|
Value: "@walkxcode/example.png",
|
|
IconSource: IconSourceWalkXCode,
|
|
},
|
|
}
|
|
overrides := GetOverrideConfig()
|
|
overrides.OverrideItem(a.Alias, want)
|
|
got := a.GetOverride(a.Alias)
|
|
expect.Equal(t, got, want)
|
|
}
|