mirror of https://github.com/Wox-launcher/Wox
test(app): update `OnGetDynamicSetting` method signature to use `definition.PluginSettingDefinitionItem`
* Changed the method signature in `emptyAPIImpl` and `mockAPI` to accept a callback that returns `definition.PluginSettingDefinitionItem`. * This improves type safety and aligns with the updated plugin API requirements.
This commit is contained in:
parent
62fdd3b7c7
commit
096ee65d18
|
@ -5,6 +5,7 @@ import (
|
|||
"testing"
|
||||
"wox/common"
|
||||
"wox/plugin"
|
||||
"wox/setting/definition"
|
||||
"wox/util"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -13,7 +14,7 @@ import (
|
|||
type emptyAPIImpl struct {
|
||||
}
|
||||
|
||||
func (e emptyAPIImpl) OnGetDynamicSetting(ctx context.Context, callback func(key string) string) {
|
||||
func (e emptyAPIImpl) OnGetDynamicSetting(context.Context, func(string) definition.PluginSettingDefinitionItem) {
|
||||
}
|
||||
|
||||
func (e emptyAPIImpl) ChangeQuery(ctx context.Context, query common.PlainQuery) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"testing"
|
||||
"wox/common"
|
||||
"wox/plugin"
|
||||
"wox/setting/definition"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
@ -263,7 +264,8 @@ func (m *mockAPI) RestartApp(ctx context.Context)
|
|||
func (m *mockAPI) ReloadPlugin(ctx context.Context, pluginId string) {}
|
||||
func (m *mockAPI) RemovePlugin(ctx context.Context, pluginId string) {}
|
||||
func (m *mockAPI) OnSettingChanged(ctx context.Context, callback func(key string, value string)) {}
|
||||
func (m *mockAPI) OnGetDynamicSetting(ctx context.Context, callback func(key string) string) {}
|
||||
func (m *mockAPI) OnGetDynamicSetting(context.Context, func(string) definition.PluginSettingDefinitionItem) {
|
||||
}
|
||||
func (m *mockAPI) OnDeepLink(ctx context.Context, callback func(arguments map[string]string)) {}
|
||||
func (m *mockAPI) OnUnload(ctx context.Context, callback func()) {}
|
||||
func (m *mockAPI) RegisterQueryCommands(ctx context.Context, commands []plugin.MetadataCommand) {}
|
||||
|
|
Loading…
Reference in New Issue