Welcome to mirror list, hosted at ThFree Co, Russian Federation.

copy_email_to_clipboard_spec.js « components « sidebar « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 704847f65bf18d465b192cd19db81a6276d33e20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
  });
});