Skip to content

Commit 2750fc8

Browse files
Fix casing experiment matching (#1688)
* PoC conditional experiment matching * Add test case * Fix broken test case * Rename experiment feature name to be lower camelcase
1 parent 95042fc commit 2750fc8

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

injected/entry-points/integration.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ function generateConfig() {
2424
},
2525
currentCohorts: [
2626
{
27-
feature: 'ContentScopeExperiments',
27+
feature: 'contentScopeExperiments',
2828
subfeature: 'bloops',
2929
cohort: 'control',
3030
},
3131
{
32-
feature: 'ContentScopeExperiments',
32+
feature: 'contentScopeExperiments',
3333
subfeature: 'test',
3434
cohort: 'treatment',
3535
},

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
<code>
1515
currentCohorts: [
1616
{
17-
"feature": "ContentScopeExperiments",
17+
"feature": "contentScopeExperiments",
1818
"subfeature": "bloops",
1919
"cohort": "control",
2020
},
2121
{
22-
"feature": "ContentScopeExperiments",
22+
"feature": "contentScopeExperiments",
2323
"subfeature": "test",
2424
"cohort": "treatment",
2525
},

injected/src/config-feature.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export default class ConfigFeature {
178178
* }
179179
* }
180180
* ```
181-
* Where featureName "ContentScopeExperiments" has a subfeature "experimentName" and cohort "cohort-name"
181+
* Where featureName "contentScopeExperiments" has a subfeature "experimentName" and cohort "cohort-name"
182182
* @param {ConditionBlock} conditionBlock
183183
* @returns {boolean}
184184
*/
@@ -190,7 +190,7 @@ export default class ConfigFeature {
190190
if (!currentCohorts) return false;
191191
return currentCohorts.some((cohort) => {
192192
return (
193-
cohort.feature === 'ContentScopeExperiments' &&
193+
cohort.feature === 'contentScopeExperiments' &&
194194
cohort.subfeature === experiment.experimentName &&
195195
cohort.cohort === experiment.cohort
196196
);

0 commit comments

Comments
 (0)