mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 09:12:56 +08:00
Plugins: Ensure fetch
loading strategy cases for nested plugins (#93209)
* fix * fix func name
This commit is contained in:
@ -76,6 +76,43 @@ func TestService_Calculate(t *testing.T) {
|
||||
}),
|
||||
expected: plugins.LoadingStrategyScript,
|
||||
},
|
||||
{
|
||||
name: "Expected LoadingStrategyFetch when parent create-plugin version is not set, is configured as CDN enabled and plugin is not angular",
|
||||
pluginSettings: setting.PluginSettings{
|
||||
"parent-datasource": {
|
||||
"cdn": "true",
|
||||
},
|
||||
},
|
||||
plugin: newPlugin(pluginID, false, func(p pluginstore.Plugin) pluginstore.Plugin {
|
||||
p.Parent = &pluginstore.ParentPlugin{ID: "parent-datasource"}
|
||||
return p
|
||||
}),
|
||||
expected: plugins.LoadingStrategyFetch,
|
||||
},
|
||||
{
|
||||
name: "Expected LoadingStrategyFetch when parent create-plugin version is not set, is configured as CDN enabled and plugin is angular",
|
||||
pluginSettings: setting.PluginSettings{
|
||||
"parent-datasource": {
|
||||
"cdn": "true",
|
||||
},
|
||||
},
|
||||
plugin: newPlugin(pluginID, false, func(p pluginstore.Plugin) pluginstore.Plugin {
|
||||
p.Angular.Detected = true
|
||||
p.Parent = &pluginstore.ParentPlugin{ID: "parent-datasource"}
|
||||
return p
|
||||
}),
|
||||
expected: plugins.LoadingStrategyFetch,
|
||||
},
|
||||
{
|
||||
name: "Expected LoadingStrategyFetch when parent create-plugin version is not set, is not configured as CDN enabled and plugin is angular",
|
||||
pluginSettings: setting.PluginSettings{},
|
||||
plugin: newPlugin(pluginID, false, func(p pluginstore.Plugin) pluginstore.Plugin {
|
||||
p.Angular.Detected = true
|
||||
p.Parent = &pluginstore.ParentPlugin{ID: "parent-datasource"}
|
||||
return p
|
||||
}),
|
||||
expected: plugins.LoadingStrategyFetch,
|
||||
},
|
||||
{
|
||||
name: "Expected LoadingStrategyFetch when create-plugin version is not compatible, plugin is not angular, is configured as CDN enabled and does not have the CDN class",
|
||||
pluginSettings: newPluginSettings(pluginID, map[string]string{
|
||||
|
Reference in New Issue
Block a user