diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-13 03:11:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-13 03:11:03 +0300 |
commit | a125ac8a014fc86f8c716229835ed0a0403a6e91 (patch) | |
tree | b72524d8c77b46bb3a3f12912f886001977f6102 /spec/frontend/experimentation | |
parent | 5dc3d39cca076fc6f05fc005d5620bfa3d09be17 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/experimentation')
-rw-r--r-- | spec/frontend/experimentation/utils_spec.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/frontend/experimentation/utils_spec.js b/spec/frontend/experimentation/utils_spec.js index df24828ceb9..923795ca3f3 100644 --- a/spec/frontend/experimentation/utils_spec.js +++ b/spec/frontend/experimentation/utils_spec.js @@ -72,6 +72,19 @@ describe('experiment Utilities', () => { it('returns an empty array if there are no experiments', () => { expect(experimentUtils.getAllExperimentContexts()).toEqual([]); }); + + it('only collects the data properties which are supported by the schema', () => { + origGl = window.gl; + window.gl.experiments = { + my_experiment: { experiment: 'my_experiment', variant: 'control', excluded: false }, + }; + + expect(experimentUtils.getAllExperimentContexts()).toEqual([ + { schema, data: { experiment: 'my_experiment', variant: 'control' } }, + ]); + + window.gl = origGl; + }); }); describe('isExperimentVariant', () => { |