Merge "Convert gr-admin-api_test.js to typescript"
diff --git a/polygerrit-ui/app/elements/plugins/gr-admin-api/gr-admin-api_test.js b/polygerrit-ui/app/elements/plugins/gr-admin-api/gr-admin-api_test.ts
similarity index 70%
rename from polygerrit-ui/app/elements/plugins/gr-admin-api/gr-admin-api_test.js
rename to polygerrit-ui/app/elements/plugins/gr-admin-api/gr-admin-api_test.ts
index 6fd2505..b953885 100644
--- a/polygerrit-ui/app/elements/plugins/gr-admin-api/gr-admin-api_test.js
+++ b/polygerrit-ui/app/elements/plugins/gr-admin-api/gr-admin-api_test.ts
@@ -15,25 +15,28 @@
* limitations under the License.
*/
-import '../../../test/common-test-setup-karma.js';
-import '../../shared/gr-js-api-interface/gr-js-api-interface.js';
-import {getPluginLoader} from '../../shared/gr-js-api-interface/gr-plugin-loader.js';
+import {AdminPluginApi} from '../../../api/admin';
+import {PluginApi} from '../../../api/plugin';
+import '../../../test/common-test-setup-karma';
+import '../../shared/gr-js-api-interface/gr-js-api-interface';
+import {getPluginLoader} from '../../shared/gr-js-api-interface/gr-plugin-loader';
suite('gr-admin-api tests', () => {
- let adminApi;
+ let adminApi: AdminPluginApi;
+ let plugin: PluginApi;
setup(() => {
- let plugin;
- window.Gerrit.install(p => { plugin = p; }, '0.1',
- 'http://test.com/plugins/testplugin/static/test.js');
+ window.Gerrit.install(
+ p => {
+ plugin = p;
+ },
+ '0.1',
+ 'http://test.com/plugins/testplugin/static/test.js'
+ );
getPluginLoader().loadPlugins([]);
adminApi = plugin.admin();
});
- teardown(() => {
- adminApi = null;
- });
-
test('exists', () => {
assert.isOk(adminApi);
});
@@ -49,8 +52,10 @@
adminApi.addMenuLink('text', 'url', 'capability');
const links = adminApi.getMenuLinks();
assert.equal(links.length, 1);
- assert.deepEqual(links[0],
- {text: 'text', url: 'url', capability: 'capability'});
+ assert.deepEqual(links[0], {
+ text: 'text',
+ url: 'url',
+ capability: 'capability',
+ });
});
});
-