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: fc8edcb573f64479f253081bab25423f20c9c8af (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
import { shallowMount } from '@vue/test-utils';
import ExpiresAtField from '~/access_tokens/components/expires_at_field.vue';

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

  const defaultPropsData = {
    inputAttrs: {
      id: 'personal_access_token_expires_at',
      name: 'personal_access_token[expires_at]',
      placeholder: 'YYYY-MM-DD',
    },
  };

  const createComponent = (propsData = defaultPropsData) => {
    wrapper = shallowMount(ExpiresAtField, {
      propsData,
    });
  };

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

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

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