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

expires_at_field_spec.js « components « access_tokens « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cd235d0afa5bccbc5dd0fa9995417f2837184773 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { shallowMount } from '@vue/test-utils';
import { useFakeDate } from 'helpers/fake_date';
import ExpiresAtField from '~/access_tokens/components/expires_at_field.vue';

describe('~/access_tokens/components/expires_at_field', () => {
  useFakeDate();

  let wrapper;

  const createComponent = () => {
    wrapper = shallowMount(ExpiresAtField, {
      propsData: {
        inputAttrs: {
          id: 'personal_access_token_expires_at',
          name: 'personal_access_token[expires_at]',
          placeholder: 'YYYY-MM-DD',
        },
      },
    });
  };

  beforeEach(() => {
    createComponent();
  });

  afterEach(() => {
    wrapper.destroy();
    wrapper = null;
  });

  it('should render datepicker with input info', () => {
    expect(wrapper.element).toMatchSnapshot();
  });
});