2020-10-16 08:09:33 -04:00
|
|
|
import { shallowMount } from '@vue/test-utils';
|
2021-03-17 14:09:01 -04:00
|
|
|
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
|
2020-10-16 08:09:33 -04:00
|
|
|
import EnableReviewAppButton from '~/environments/components/enable_review_app_modal.vue';
|
2021-02-14 13:09:20 -05:00
|
|
|
import ModalCopyButton from '~/vue_shared/components/modal_copy_button.vue';
|
2020-02-04 13:08:50 -05:00
|
|
|
|
|
|
|
describe('Enable Review App Button', () => {
|
|
|
|
let wrapper;
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
wrapper.destroy();
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('renders the modal', () => {
|
|
|
|
beforeEach(() => {
|
2021-03-17 14:09:01 -04:00
|
|
|
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-02-04 13:08:50 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
it('renders the copyToClipboard button', () => {
|
2021-03-17 14:09:01 -04:00
|
|
|
expect(wrapper.findComponent(ModalCopyButton).exists()).toBe(true);
|
2020-02-04 13:08:50 -05:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|