diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-09 15:15:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-09 15:15:13 +0300 |
commit | 0b4adad74b76b34855e9a6d943f9b9188c3914fa (patch) | |
tree | 1084ffd8336bc8e9af6f7042a093bf78e0852ac3 /spec/frontend/authentication | |
parent | ece36a21699c2a218b8bd14b22bea47d22218354 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/authentication')
-rw-r--r-- | spec/frontend/authentication/password/components/password_input_spec.js | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/spec/frontend/authentication/password/components/password_input_spec.js b/spec/frontend/authentication/password/components/password_input_spec.js index 623d986b36e..9960539af10 100644 --- a/spec/frontend/authentication/password/components/password_input_spec.js +++ b/spec/frontend/authentication/password/components/password_input_spec.js @@ -5,17 +5,21 @@ import { SHOW_PASSWORD, HIDE_PASSWORD } from '~/authentication/password/constant describe('PasswordInput', () => { let wrapper; + const propsData = { + title: 'This field is required', + id: 'new_user_password', + minimumPasswordLength: '8', + qaSelector: 'new_user_password_field', + autocomplete: 'new-password', + name: 'new_user', + }; const findPasswordInput = () => wrapper.findComponent(GlFormInput); const findToggleButton = () => wrapper.findComponent(GlButton); const createComponent = () => { return shallowMount(PasswordInput, { - propsData: { - resourceName: 'new_user', - minimumPasswordLength: '8', - qaSelector: 'new_user_password_field', - }, + propsData, }); }; @@ -23,6 +27,15 @@ describe('PasswordInput', () => { wrapper = createComponent(); }); + it('sets password input attributes correctly', () => { + expect(findPasswordInput().attributes('id')).toBe(propsData.id); + expect(findPasswordInput().attributes('autocomplete')).toBe(propsData.autocomplete); + expect(findPasswordInput().attributes('name')).toBe(propsData.name); + expect(findPasswordInput().attributes('minlength')).toBe(propsData.minimumPasswordLength); + expect(findPasswordInput().attributes('data-qa-selector')).toBe(propsData.qaSelector); + expect(findPasswordInput().attributes('title')).toBe(propsData.title); + }); + describe('when the show password button is clicked', () => { beforeEach(() => { findToggleButton().vm.$emit('click'); |