fix: update experiments tests to include new SHOW_ENHANCE_PROMPT_BUTTON experiment

This commit is contained in:
Roo Code 2025-07-25 09:27:49 +00:00
parent 0e1c968fba
commit 0baf45dc35

View file

@ -23,11 +23,21 @@ describe("experiments", () => {
})
})
describe("SHOW_ENHANCE_PROMPT_BUTTON", () => {
it("is configured correctly", () => {
expect(EXPERIMENT_IDS.SHOW_ENHANCE_PROMPT_BUTTON).toBe("showEnhancePromptButton")
expect(experimentConfigsMap.SHOW_ENHANCE_PROMPT_BUTTON).toMatchObject({
enabled: true,
})
})
})
describe("isEnabled", () => {
it("returns false when POWER_STEERING experiment is not enabled", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: false,
multiFileApplyDiff: false,
showEnhancePromptButton: true,
}
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.POWER_STEERING)).toBe(false)
})
@ -36,6 +46,7 @@ describe("experiments", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: true,
multiFileApplyDiff: false,
showEnhancePromptButton: true,
}
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.POWER_STEERING)).toBe(true)
})
@ -44,8 +55,27 @@ describe("experiments", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: false,
multiFileApplyDiff: false,
showEnhancePromptButton: true,
}
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.POWER_STEERING)).toBe(false)
})
it("returns true when SHOW_ENHANCE_PROMPT_BUTTON is enabled", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: false,
multiFileApplyDiff: false,
showEnhancePromptButton: true,
}
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.SHOW_ENHANCE_PROMPT_BUTTON)).toBe(true)
})
it("returns false when SHOW_ENHANCE_PROMPT_BUTTON is disabled", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: false,
multiFileApplyDiff: false,
showEnhancePromptButton: false,
}
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.SHOW_ENHANCE_PROMPT_BUTTON)).toBe(false)
})
})
})