diff --git a/src/test/selectProfile.test.ts b/src/test/selectProfile.test.ts index cd4753a..dc77959 100755 --- a/src/test/selectProfile.test.ts +++ b/src/test/selectProfile.test.ts @@ -1,12 +1,21 @@ /* eslint @typescript-eslint/no-explicit-any: "off" */ import { assert } from "chai"; import * as vscode from "vscode"; -import { ConfigKey, ConfigProfilesKey, ConfigStorageKey } from "../constants"; +import { + ConfigKey, + ConfigProfilesKey, + ConfigStorageKey, + ConfigExtensionsKey +} from "../constants"; import Config from "../services/config"; +import { ExtensionInfo } from "../services/extensions"; suite("select profile", () => { const expectedProfileName = "test1"; const expectedProfileSettings = { foo: "bar" }; + const expectedExtensions = [ + new ExtensionInfo("abcd", "test.ext", "test", "1.0.0", "ext") + ]; setup(async () => { let config = vscode.workspace.getConfiguration(ConfigKey); @@ -23,6 +32,13 @@ suite("select profile", () => { }, vscode.ConfigurationTarget.Global ); + await config.update( + ConfigExtensionsKey, + { + [expectedProfileName]: expectedExtensions + }, + vscode.ConfigurationTarget.Global + ); }); teardown(async () => { @@ -38,6 +54,11 @@ suite("select profile", () => { undefined, vscode.ConfigurationTarget.Global ); + await config.update( + ConfigExtensionsKey, + undefined, + vscode.ConfigurationTarget.Global + ); }); test("list of profiles will contain the expected one", () => { @@ -48,11 +69,19 @@ suite("select profile", () => { assert.include(profiles, expectedProfileName); }); - test("storage contains the expected profile", () => { + test("storage contains the expected profile settings", () => { let config = new Config(); let settings = config.getProfileSettings(expectedProfileName); assert.deepEqual(settings, expectedProfileSettings); }); + + test("storage contains the expected profile settings", () => { + let config = new Config(); + + let extensions = config.getProfileExtensions(expectedProfileName); + + assert.deepEqual(extensions, expectedExtensions); + }); });