Skip to content

Commit

Permalink
perf(type-b): rename feature flag name for type b auth (#11507)
Browse files Browse the repository at this point in the history
Co-authored-by: rentu <[email protected]>
  • Loading branch information
SLdragon and SLdragon authored Apr 29, 2024
1 parent 4d54e2a commit b389a0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/fx-core/src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ export class FeatureFlagName {
static readonly NewProjectType = "TEAMSFX_NEW_PROJECT_TYPE";
static readonly ChatParticipant = "TEAMSFX_CHAT_PARTICIPANT";
static readonly NewGenerator = "TEAMSFX_NEW_GENERATOR";
static readonly CopilotAuth = "TEAMSFX_COPILOT_AUTH";
static readonly CopilotAuth = "API_COPILOT_PLUGIN_AUTH";
static readonly CustomizeGpt = "TEAMSFX_DECLARATIVE_COPILOT";
}
8 changes: 4 additions & 4 deletions packages/fx-core/tests/common/featureFlags.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ describe("featureFlags", () => {
mockedEnvRestore();
});
it("is true", async () => {
mockedEnvRestore = mockedEnv({ TEAMSFX_COPILOT_AUTH: "true" });
mockedEnvRestore = mockedEnv({ API_COPILOT_PLUGIN_AUTH: "true" });
const res = isCopilotAuthEnabled();
chai.assert.isTrue(res);
});
it("is false", async () => {
mockedEnvRestore = mockedEnv({ TEAMSFX_COPILOT_AUTH: "false" });
mockedEnvRestore = mockedEnv({ API_COPILOT_PLUGIN_AUTH: "false" });
const res = isCopilotAuthEnabled();
chai.assert.isFalse(res);
});
Expand All @@ -56,14 +56,14 @@ describe("FeatureFlagManager", () => {
mockedEnvRestore();
});
it("getBooleanValue, getStringValue is true", async () => {
mockedEnvRestore = mockedEnv({ TEAMSFX_COPILOT_AUTH: "true" });
mockedEnvRestore = mockedEnv({ API_COPILOT_PLUGIN_AUTH: "true" });
const booleanRes = featureFlagManager.getBooleanValue(FeatureFlags.CopilotAuth);
chai.assert.isTrue(booleanRes);
const stringRes = featureFlagManager.getStringValue(FeatureFlags.CopilotAuth);
chai.assert.equal(stringRes, "true");
});
it("getBooleanValue, getStringValue is false", async () => {
mockedEnvRestore = mockedEnv({ TEAMSFX_COPILOT_AUTH: "false" });
mockedEnvRestore = mockedEnv({ API_COPILOT_PLUGIN_AUTH: "false" });
const booleanRes = featureFlagManager.getBooleanValue(FeatureFlags.CopilotAuth);
chai.assert.isFalse(booleanRes);
const stringRes = featureFlagManager.getStringValue(FeatureFlags.CopilotAuth);
Expand Down

0 comments on commit b389a0e

Please sign in to comment.