Commit 6ea17c73 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Update settings panel specs

parent 479fa989
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
visibilityLevelDescriptions, visibilityLevelDescriptions,
visibilityOptions, visibilityOptions,
} from '~/pages/projects/shared/permissions/constants'; } from '~/pages/projects/shared/permissions/constants';
import ConfirmDanger from '~/vue_shared/components/confirm_danger/confirm_danger.vue';
const defaultProps = { const defaultProps = {
currentSettings: { currentSettings: {
...@@ -47,6 +48,7 @@ const defaultProps = { ...@@ -47,6 +48,7 @@ const defaultProps = {
packagesAvailable: false, packagesAvailable: false,
packagesHelpPath: '/help/user/packages/index', packagesHelpPath: '/help/user/packages/index',
requestCveAvailable: true, requestCveAvailable: true,
confirmationPhrase: 'my-fake-project',
}; };
describe('Settings Panel', () => { describe('Settings Panel', () => {
...@@ -104,6 +106,7 @@ describe('Settings Panel', () => { ...@@ -104,6 +106,7 @@ describe('Settings Panel', () => {
); );
const findMetricsVisibilitySettings = () => wrapper.find({ ref: 'metrics-visibility-settings' }); const findMetricsVisibilitySettings = () => wrapper.find({ ref: 'metrics-visibility-settings' });
const findOperationsSettings = () => wrapper.find({ ref: 'operations-settings' }); const findOperationsSettings = () => wrapper.find({ ref: 'operations-settings' });
const findConfirmDangerButton = () => wrapper.findComponent(ConfirmDanger);
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
...@@ -177,6 +180,18 @@ describe('Settings Panel', () => { ...@@ -177,6 +180,18 @@ describe('Settings Panel', () => {
expect(findRequestAccessEnabledInput().exists()).toBe(false); expect(findRequestAccessEnabledInput().exists()).toBe(false);
}); });
it('should render the confirmation dialog if the visibility is reduced', async () => {
wrapper = mountComponent({
currentSettings: { visibilityLevel: visibilityOptions.INTERNAL },
});
expect(findConfirmDangerButton().exists()).toBe(false);
await findProjectVisibilityLevelInput().setValue(visibilityOptions.PRIVATE);
expect(findConfirmDangerButton().exists()).toBe(true);
});
}); });
describe('Issues settings', () => { describe('Issues settings', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment