|
1 | 1 | import { ConfigurationTarget } from "vscode"; |
2 | | -import { |
3 | | - VARIANT_ANALYSIS_ENABLE_GHEC_DR, |
4 | | - VSCODE_GITHUB_ENTERPRISE_URI_SETTING, |
5 | | -} from "../../../../src/config"; |
| 2 | +import { VSCODE_GITHUB_ENTERPRISE_URI_SETTING } from "../../../../src/config"; |
6 | 3 | import { isVariantAnalysisEnabledForGitHubHost } from "../../../../src/variant-analysis/ghec-dr"; |
7 | 4 |
|
8 | 5 | describe("checkVariantAnalysisEnabled", () => { |
9 | | - it("returns cleanly when no enterprise URI is set", async () => { |
| 6 | + it("returns true when no enterprise URI is set", async () => { |
10 | 7 | expect(isVariantAnalysisEnabledForGitHubHost()).toBe(true); |
11 | 8 | }); |
12 | 9 |
|
13 | | - it("returns false when GHES enterprise URI is set and variant analysis feature flag is not set", async () => { |
| 10 | + it("returns false when GHES enterprise URI is set", async () => { |
14 | 11 | await VSCODE_GITHUB_ENTERPRISE_URI_SETTING.updateValue( |
15 | 12 | "https://github.example.com", |
16 | 13 | ConfigurationTarget.Global, |
17 | 14 | ); |
18 | 15 | expect(isVariantAnalysisEnabledForGitHubHost()).toBe(false); |
19 | 16 | }); |
20 | 17 |
|
21 | | - it("returns false when GHES enterprise URI is set and variant analysis feature flag is set", async () => { |
22 | | - await VSCODE_GITHUB_ENTERPRISE_URI_SETTING.updateValue( |
23 | | - "https://github.example.com", |
24 | | - ConfigurationTarget.Global, |
25 | | - ); |
26 | | - await VARIANT_ANALYSIS_ENABLE_GHEC_DR.updateValue( |
27 | | - "true", |
28 | | - ConfigurationTarget.Global, |
29 | | - ); |
30 | | - expect(isVariantAnalysisEnabledForGitHubHost()).toBe(false); |
31 | | - }); |
32 | | - |
33 | | - it("returns false when GHEC-DR URI is set and variant analysis feature flag is not set", async () => { |
| 18 | + it("returns true when a GHEC-DR URI is set", async () => { |
34 | 19 | await VSCODE_GITHUB_ENTERPRISE_URI_SETTING.updateValue( |
35 | 20 | "https://example.ghe.com", |
36 | 21 | ConfigurationTarget.Global, |
37 | 22 | ); |
38 | | - expect(isVariantAnalysisEnabledForGitHubHost()).toBe(false); |
39 | | - }); |
40 | | - |
41 | | - it("returns true when GHEC-DR URI is set and variant analysis feature flag is set", async () => { |
42 | | - await VSCODE_GITHUB_ENTERPRISE_URI_SETTING.updateValue( |
43 | | - "https://example.ghe.com", |
44 | | - ConfigurationTarget.Global, |
45 | | - ); |
46 | | - await VARIANT_ANALYSIS_ENABLE_GHEC_DR.updateValue( |
47 | | - "true", |
48 | | - ConfigurationTarget.Global, |
49 | | - ); |
50 | 23 | expect(isVariantAnalysisEnabledForGitHubHost()).toBe(true); |
51 | 24 | }); |
52 | 25 | }); |
0 commit comments