diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-12 03:09:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-12 03:09:44 +0300 |
commit | 88544d284c0a25d45ea51c1817fcab1c7e99afe7 (patch) | |
tree | 7ae1c1fb6982eadb803de5f80e069fac8574e84d /spec/frontend/access_tokens | |
parent | 15f6e7bab546b32b7ada8aa2019b06b7bda12c1d (diff) |
Add latest changes from gitlab-org/gitlab@master
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(); + }); +}); |