|
20 | 20 | */ |
21 | 21 |
|
22 | 22 | /*jslint regexp: true */ |
23 | | -/*global describe, it, spyOn, expect, beforeEach, afterEach, awaitsForFail, awaitsForDone */ |
| 23 | +/*global describe, it, spyOn, expect, beforeEach, afterEach, awaitsForFail, awaitsForDone, awaitsFor */ |
24 | 24 |
|
25 | 25 | define(function (require, exports, module) { |
26 | 26 |
|
27 | 27 |
|
28 | 28 | // Load dependent modules |
29 | 29 | var ExtensionLoader = require("utils/ExtensionLoader"), |
| 30 | + ThemeManager = require("view/ThemeManager"), |
30 | 31 | SpecRunnerUtils = require("spec/SpecRunnerUtils"); |
31 | 32 |
|
32 | 33 | const testPath = SpecRunnerUtils.getTestPath("/spec/ExtensionLoader-test-files"); |
@@ -125,5 +126,23 @@ define(function (require, exports, module) { |
125 | 126 | await testLoadExtension("BadRequireConfig", "resolved", /^\[Extension\] The require config file provided is invalid/); |
126 | 127 | }); |
127 | 128 |
|
| 129 | + it("should load a custom extension", async function () { |
| 130 | + await awaitsForDone(ExtensionLoader.loadExtensionFromNativeDirectory(`${testPath}/extension`)); |
| 131 | + expect(window.extensionLoaderTestExtensionLoaded).toBeTrue(); |
| 132 | + }); |
| 133 | + |
| 134 | + it("should load a custom theme", async function () { |
| 135 | + await awaitsForDone(ExtensionLoader.loadExtensionFromNativeDirectory(`${testPath}/theme`)); |
| 136 | + expect(window.extensionLoaderTestExtensionLoaded).toBeTrue(); |
| 137 | + await awaitsFor(function () { |
| 138 | + let themes = ThemeManager.getAllThemes(); |
| 139 | + for(let theme of themes){ |
| 140 | + if(theme.name === "da-theme"){ |
| 141 | + return true; |
| 142 | + } |
| 143 | + } |
| 144 | + return false; |
| 145 | + }, "custom theme to be loaded"); |
| 146 | + }); |
128 | 147 | }); |
129 | 148 | }); |
0 commit comments