diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /spec/frontend/crm/contact_form_wrapper_spec.js | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'spec/frontend/crm/contact_form_wrapper_spec.js')
-rw-r--r-- | spec/frontend/crm/contact_form_wrapper_spec.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/frontend/crm/contact_form_wrapper_spec.js b/spec/frontend/crm/contact_form_wrapper_spec.js index 5e1743701e4..e49b553e4b5 100644 --- a/spec/frontend/crm/contact_form_wrapper_spec.js +++ b/spec/frontend/crm/contact_form_wrapper_spec.js @@ -56,8 +56,9 @@ describe('Customer relations contact form wrapper', () => { ${'edit'} | ${'Edit contact'} | ${'Contact has been updated.'} | ${updateContactMutation} | ${contacts[0].id} ${'create'} | ${'New contact'} | ${'Contact has been added.'} | ${createContactMutation} | ${null} `('in $mode mode', ({ mode, title, successMessage, mutation, existingId }) => { + const isEditMode = mode === 'edit'; + beforeEach(() => { - const isEditMode = mode === 'edit'; mountComponent({ isEditMode }); return waitForPromises(); @@ -82,7 +83,7 @@ describe('Customer relations contact form wrapper', () => { }); it('renders correct fields prop', () => { - expect(findContactForm().props('fields')).toEqual([ + const fields = [ { name: 'firstName', label: 'First name', required: true }, { name: 'lastName', label: 'Last name', required: true }, { name: 'email', label: 'Email', required: true }, @@ -98,7 +99,9 @@ describe('Customer relations contact form wrapper', () => { ], }, { name: 'description', label: 'Description' }, - ]); + ]; + if (isEditMode) fields.push({ name: 'active', label: 'Active', required: true, bool: true }); + expect(findContactForm().props('fields')).toEqual(fields); }); it('renders correct title prop', () => { |