summaryrefslogtreecommitdiff
path: root/spec/frontend/pages
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-20 18:38:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-20 18:38:24 +0000
commit983a0bba5d2a042c4a3bbb22432ec192c7501d82 (patch)
treeb153cd387c14ba23bd5a07514c7c01fddf6a78a0 /spec/frontend/pages
parenta2bddee2cdb38673df0e004d5b32d9f77797de64 (diff)
downloadgitlab-ce-983a0bba5d2a042c4a3bbb22432ec192c7501d82.tar.gz
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'spec/frontend/pages')
-rw-r--r--spec/frontend/pages/projects/shared/permissions/components/settings_panel_spec.js31
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',
+ );
+ });
+ });
});