diff options
Diffstat (limited to 'spec/frontend/access_tokens')
-rw-r--r-- | spec/frontend/access_tokens/components/__snapshots__/expires_at_field_spec.js.snap | 24 | ||||
-rw-r--r-- | spec/frontend/access_tokens/components/expires_at_field_spec.js | 34 |
2 files changed, 58 insertions, 0 deletions
diff --git a/spec/frontend/access_tokens/components/__snapshots__/expires_at_field_spec.js.snap b/spec/frontend/access_tokens/components/__snapshots__/expires_at_field_spec.js.snap new file mode 100644 index 00000000000..33c29cea6d8 --- /dev/null +++ b/spec/frontend/access_tokens/components/__snapshots__/expires_at_field_spec.js.snap @@ -0,0 +1,24 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`~/access_tokens/components/expires_at_field should render datepicker with input info 1`] = ` +<gl-datepicker-stub + ariallabel="" + autocomplete="" + container="" + displayfield="true" + firstday="0" + mindate="Mon Jul 06 2020 00:00:00 GMT+0000 (Greenwich Mean Time)" + placeholder="YYYY-MM-DD" + theme="" +> + <gl-form-input-stub + autocomplete="off" + class="datepicker gl-datepicker-input" + data-qa-selector="expiry_date_field" + id="personal_access_token_expires_at" + inputmode="none" + name="personal_access_token[expires_at]" + placeholder="YYYY-MM-DD" + /> +</gl-datepicker-stub> +`; 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(); + }); +}); |