Skip to content

Commit 2f67cce

Browse files
Cover all cases of URIs and feature flags
1 parent b3fdb3a commit 2f67cce

File tree

1 file changed

+11
-3
lines changed
  • extensions/ql-vscode/test/vscode-tests/minimal-workspace/variant-analysis

1 file changed

+11
-3
lines changed

extensions/ql-vscode/test/vscode-tests/minimal-workspace/variant-analysis/ghec-dr.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ describe("checkVariantAnalysisEnabled", () => {
1010
expect(isVariantAnalysisEnabledForGitHubHost()).toBe(true);
1111
});
1212

13-
it("returns false when GHES enterprise URI is set", async () => {
13+
it("returns false when GHES enterprise URI is set and variant analysis feature flag is not set", async () => {
14+
await VSCODE_GITHUB_ENTERPRISE_URI_SETTING.updateValue(
15+
"https://github.example.com",
16+
ConfigurationTarget.Global,
17+
);
18+
expect(isVariantAnalysisEnabledForGitHubHost()).toBe(false);
19+
});
20+
21+
it("returns false when GHES enterprise URI is set and variant analysis feature flag is set", async () => {
1422
await VSCODE_GITHUB_ENTERPRISE_URI_SETTING.updateValue(
1523
"https://github.example.com",
1624
ConfigurationTarget.Global,
@@ -22,9 +30,9 @@ describe("checkVariantAnalysisEnabled", () => {
2230
expect(isVariantAnalysisEnabledForGitHubHost()).toBe(false);
2331
});
2432

25-
it("returns false when GHEC-DR URI is set but variant analysis feature flag is not set", async () => {
33+
it("returns false when GHEC-DR URI is set and variant analysis feature flag is not set", async () => {
2634
await VSCODE_GITHUB_ENTERPRISE_URI_SETTING.updateValue(
27-
"https://github.example.com",
35+
"https://example.ghe.com",
2836
ConfigurationTarget.Global,
2937
);
3038
expect(isVariantAnalysisEnabledForGitHubHost()).toBe(false);

0 commit comments

Comments
 (0)