2020-03-30 18:08:07 +00:00
|
|
|
import { shallowMount } from '@vue/test-utils';
|
|
|
|
import MaintenanceModeSettingsApp from '~/maintenance_mode_settings/components/app.vue';
|
2020-04-03 09:09:31 +00:00
|
|
|
import { GlToggle, GlFormTextarea, GlDeprecatedButton } from '@gitlab/ui';
|
2020-03-30 18:08:07 +00:00
|
|
|
|
|
|
|
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-04-03 09:09:31 +00:00
|
|
|
const findGlButton = () => wrapper.find(GlDeprecatedButton);
|
2020-03-30 18:08:07 +00:00
|
|
|
|
|
|
|
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-04-03 09:09:31 +00:00
|
|
|
it('renders the GlDeprecatedButton', () => {
|
2020-03-30 18:08:07 +00:00
|
|
|
expect(findGlButton().exists()).toBe(true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|