Pass config into plugin loader correctly

Plugin section that includes .js and .html plugins was passed instead of
the entire config. That is required to correctly recognize default site
theme.

Also fixes plugin name handling for site theme served from
/static/gerrit-theme.html.

Change-Id: I27ecc9f8698cb1ea359971ebeb6b14788fef51fd
This commit is contained in:
Viktar Donich
2017-08-10 16:02:48 -07:00
parent c85a1db488
commit ffe8864542
7 changed files with 50 additions and 42 deletions

View File

@@ -50,7 +50,7 @@ limitations under the License.
getConfig() {
return Promise.resolve({
gerrit: {web_uis: ['GWT', 'POLYGERRIT']},
plugin: {js_resource_paths: []},
plugin: {},
});
},
getPreferences() { return Promise.resolve({my: []}); },
@@ -100,11 +100,9 @@ limitations under the License.
});
});
test('passes config to gr-plugin-host', done => {
element.$.restAPI.getConfig.lastCall.returnValue.then(config => {
const pluginConfig = config.plugin;
assert.deepEqual(element.$.plugins.config, pluginConfig);
done();
test('passes config to gr-plugin-host', () => {
return element.$.restAPI.getConfig.lastCall.returnValue.then(config => {
assert.deepEqual(element.$.plugins.config, config);
});
});
});