fix: show all experiments in deployments list if opted into (#10722)

This commit is contained in:
Kira Pilot
2023-11-16 10:53:35 -05:00
committed by GitHub
parent 0e5eecd7da
commit 9f3a955ebf
2 changed files with 17 additions and 2 deletions
@@ -97,7 +97,11 @@ describe("optionValue", () => {
value: ["moons"],
},
additionalValues: ["single_tailnet", "deployment_health_page"],
expected: { single_tailnet: false, deployment_health_page: false },
expected: {
single_tailnet: false,
deployment_health_page: false,
moons: true,
},
},
{
option: {
@@ -108,6 +112,15 @@ describe("optionValue", () => {
additionalValues: ["single_tailnet", "deployment_health_page"],
expected: { single_tailnet: true, deployment_health_page: true },
},
{
option: {
...defaultOption,
name: "Experiments",
value: ["*", "moons", "single_tailnet"],
},
additionalValues: ["single_tailnet"],
expected: { moons: true, single_tailnet: true },
},
{
option: {
...defaultOption,
@@ -50,8 +50,10 @@ export function optionValue(
break;
}
// We show all experiments (including unsafe) that are currently enabled on a deployment
// but only show safe experiments that are not.
for (const v of option.value) {
if (Object.hasOwn(experimentMap, v)) {
if (v !== "*") {
experimentMap[v] = true;
}
}