debian-mirror-gitlab/spec/frontend/environments/enable_review_app_modal_spec.js

37 lines
1 KiB
JavaScript
Raw Normal View History

2021-01-03 14:25:43 +05:30
import { shallowMount } from '@vue/test-utils';
2021-04-29 21:17:54 +05:30
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
2021-01-03 14:25:43 +05:30
import EnableReviewAppButton from '~/environments/components/enable_review_app_modal.vue';
2021-03-11 19:13:27 +05:30
import ModalCopyButton from '~/vue_shared/components/modal_copy_button.vue';
2020-03-13 15:44:24 +05:30
describe('Enable Review App Button', () => {
let wrapper;
afterEach(() => {
wrapper.destroy();
});
describe('renders the modal', () => {
beforeEach(() => {
2021-04-29 21:17:54 +05:30
wrapper = extendedWrapper(
shallowMount(EnableReviewAppButton, {
propsData: {
modalId: 'fake-id',
},
provide: {
defaultBranchName: 'main',
},
}),
);
});
it('renders the defaultBranchName copy', () => {
const findCopyString = () => wrapper.findByTestId('enable-review-app-copy-string');
expect(findCopyString().text()).toContain('- main');
2020-03-13 15:44:24 +05:30
});
it('renders the copyToClipboard button', () => {
2021-04-29 21:17:54 +05:30
expect(wrapper.findComponent(ModalCopyButton).exists()).toBe(true);
2020-03-13 15:44:24 +05:30
});
});
});