diff options
Diffstat (limited to 'spec/frontend/pages/projects/shared/permissions/components')
-rw-r--r-- | spec/frontend/pages/projects/shared/permissions/components/settings_panel_spec.js | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/spec/frontend/pages/projects/shared/permissions/components/settings_panel_spec.js b/spec/frontend/pages/projects/shared/permissions/components/settings_panel_spec.js index d3932ca09ff..9c292fa0f2b 100644 --- a/spec/frontend/pages/projects/shared/permissions/components/settings_panel_spec.js +++ b/spec/frontend/pages/projects/shared/permissions/components/settings_panel_spec.js @@ -55,7 +55,12 @@ describe('Settings Panel', () => { currentSettings: { ...defaultProps.currentSettings, ...currentSettings }, }; - return mountFn(settingsPanel, { propsData }); + return mountFn(settingsPanel, { + propsData, + provide: { + glFeatures: { metricsDashboardVisibilitySwitchingAvailable: true }, + }, + }); }; const overrideCurrentSettings = (currentSettingsProps, extraProps = {}) => { @@ -471,4 +476,28 @@ describe('Settings Panel', () => { }); }); }); + + describe('Metrics dashboard', () => { + it('should show the metrics dashboard access toggle', () => { + return wrapper.vm.$nextTick(() => { + expect(wrapper.find({ ref: 'metrics-visibility-settings' }).exists()).toBe(true); + }); + }); + + it('should set the visibility level description based upon the selected visibility level', () => { + wrapper + .find('[name="project[project_feature_attributes][metrics_dashboard_access_level]"]') + .setValue(visibilityOptions.PUBLIC); + + expect(wrapper.vm.metricsAccessLevel).toBe(visibilityOptions.PUBLIC); + }); + + it('should contain help text', () => { + wrapper = overrideCurrentSettings({ visibilityLevel: visibilityOptions.PRIVATE }); + + expect(wrapper.find({ ref: 'metrics-visibility-settings' }).props().helpText).toEqual( + 'With Metrics Dashboard you can visualize this project performance metrics', + ); + }); + }); }); |