diff --git a/src/test/removeProfile.test.ts b/src/test/removeProfile.test.ts index 0b4d8fe..33bcaf8 100755 --- a/src/test/removeProfile.test.ts +++ b/src/test/removeProfile.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("remove 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("remove profile", () => { }, vscode.ConfigurationTarget.Global ); + await config.update( + ConfigExtensionsKey, + { + [expectedProfileName]: expectedExtensions + }, + vscode.ConfigurationTarget.Global + ); }); test("can remove profile name", async () => { @@ -44,4 +60,14 @@ suite("remove profile", () => { assert.isUndefined(settings); }); + + test("can remove profile extensions", async () => { + let config = new Config(); + + await config.removeProfileExtensions(expectedProfileName); + + let extensions = config.getProfileExtensions(expectedProfileName); + + assert.isEmpty(extensions); + }); });