Skip to content

Commit c012c4e

Browse files
Fix broken test case
1 parent d6a1694 commit c012c4e

File tree

2 files changed

+35
-33
lines changed

2 files changed

+35
-33
lines changed

injected/integration-test/test-pages/infra/config/conditional-matching-experiments.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -45,40 +45,40 @@
4545
"value": 100
4646
}
4747
}
48-
}
49-
},
50-
"conditionalChanges": [
51-
{
52-
"condition": {
53-
"experiment": {
54-
"experimentName": "bloops",
55-
"cohort": "treatment"
56-
}
57-
},
58-
"patchSettings": [
59-
{
60-
"op": "replace",
61-
"path": "/apiChanges/Navigator.prototype.hardwareConcurrency/getterValue/value",
62-
"value": 200
63-
}
64-
]
6548
},
66-
{
67-
"condition": {
68-
"experiment": {
69-
"experimentName": "bloops",
70-
"cohort": "control"
71-
}
49+
"conditionalChanges": [
50+
{
51+
"condition": {
52+
"experiment": {
53+
"experimentName": "bloops",
54+
"cohort": "treatment"
55+
}
56+
},
57+
"patchSettings": [
58+
{
59+
"op": "replace",
60+
"path": "/apiChanges/Navigator.prototype.hardwareConcurrency/getterValue/value",
61+
"value": 200
62+
}
63+
]
7264
},
73-
"patchSettings": [
74-
{
75-
"op": "replace",
76-
"path": "/apiChanges/Navigator.prototype.hardwareConcurrency/getterValue/value",
77-
"value": 300
78-
}
79-
]
80-
}
81-
]
65+
{
66+
"condition": {
67+
"experiment": {
68+
"experimentName": "bloops",
69+
"cohort": "control"
70+
}
71+
},
72+
"patchSettings": [
73+
{
74+
"op": "replace",
75+
"path": "/apiChanges/Navigator.prototype.hardwareConcurrency/getterValue/value",
76+
"value": 300
77+
}
78+
]
79+
}
80+
]
81+
}
8282
},
8383
"exceptions": []
8484
}

injected/integration-test/test-pages/infra/pages/conditional-matching-experiments.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@
3030
<script>
3131
test('Conditional matching experiments', async () => {
3232
const res = navigator.hardwareConcurrency;
33+
// Either is valid here, but 100 is the default which would mean the experiment is not running
34+
const expected = res === 200 ? 200 : 300;
3335
const results = [
3436
{
3537
name: "APIs changing, expecting to always match",
3638
result: res,
37-
expected: res === 200 || res === 300, // Either is valid here, but 100 is the default which would mean the experiment is not running
39+
expected: expected,
3840
}
3941
];
4042
return results;

0 commit comments

Comments
 (0)