From 828c2669ebd0a631c17045d083ed129eb4241168 Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Wed, 3 Jul 2019 14:02:52 +1000 Subject: [PATCH] test for removing extensions from profile --- src/test/removeProfile.test.ts | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) 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); + }); });