2020-04-22 19:07:51 +05:30
|
|
|
import { shallowMount } from '@vue/test-utils';
|
2020-10-24 23:57:45 +05:30
|
|
|
import { GlToggle, GlFormTextarea, GlButton } from '@gitlab/ui';
|
2020-04-22 19:07:51 +05:30
|
|
|
import MaintenanceModeSettingsApp from '~/maintenance_mode_settings/components/app.vue';
|
|
|
|
|
|
|
|
describe('MaintenanceModeSettingsApp', () => {
|
|
|
|
let wrapper;
|
|
|
|
|
|
|
|
const createComponent = () => {
|
|
|
|
wrapper = shallowMount(MaintenanceModeSettingsApp);
|
|
|
|
};
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
wrapper.destroy();
|
|
|
|
});
|
|
|
|
|
|
|
|
const findMaintenanceModeSettingsContainer = () => wrapper.find('article');
|
|
|
|
const findGlToggle = () => wrapper.find(GlToggle);
|
|
|
|
const findGlFormTextarea = () => wrapper.find(GlFormTextarea);
|
2020-10-24 23:57:45 +05:30
|
|
|
const findGlButton = () => wrapper.find(GlButton);
|
2020-04-22 19:07:51 +05:30
|
|
|
|
|
|
|
describe('template', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
createComponent();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders the Maintenance Mode Settings container', () => {
|
|
|
|
expect(findMaintenanceModeSettingsContainer().exists()).toBe(true);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders the GlToggle', () => {
|
|
|
|
expect(findGlToggle().exists()).toBe(true);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders the GlFormTextarea', () => {
|
|
|
|
expect(findGlFormTextarea().exists()).toBe(true);
|
|
|
|
});
|
|
|
|
|
2020-10-24 23:57:45 +05:30
|
|
|
it('renders the GlButton', () => {
|
2020-04-22 19:07:51 +05:30
|
|
|
expect(findGlButton().exists()).toBe(true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|