22 lines
771 B
JavaScript
22 lines
771 B
JavaScript
import { getByText } from '@testing-library/dom';
|
|
import { mount } from '@vue/test-utils';
|
|
import CopyEmailToClipboard from '~/sidebar/components/copy_email_to_clipboard.vue';
|
|
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
|
|
|
|
describe('CopyEmailToClipboard component', () => {
|
|
const sampleEmail = 'sample+email@test.com';
|
|
|
|
const wrapper = mount(CopyEmailToClipboard, {
|
|
propsData: {
|
|
copyText: sampleEmail,
|
|
},
|
|
});
|
|
|
|
it('renders the Issue email text with the forwardable email', () => {
|
|
expect(getByText(wrapper.element, `Issue email: ${sampleEmail}`)).not.toBeNull();
|
|
});
|
|
|
|
it('finds ClipboardButton with the correct props', () => {
|
|
expect(wrapper.find(ClipboardButton).props('text')).toBe(sampleEmail);
|
|
});
|
|
});
|