diff options
Diffstat (limited to 'spec/frontend/access_tokens/components/expires_at_field_spec.js')
-rw-r--r-- | spec/frontend/access_tokens/components/expires_at_field_spec.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/frontend/access_tokens/components/expires_at_field_spec.js b/spec/frontend/access_tokens/components/expires_at_field_spec.js new file mode 100644 index 00000000000..cd235d0afa5 --- /dev/null +++ b/spec/frontend/access_tokens/components/expires_at_field_spec.js @@ -0,0 +1,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(); + }); +}); |