From 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 18 Jun 2020 11:18:50 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-1-stable-ee --- .../edit/components/integration_form_spec.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'spec/frontend/integrations/edit/components/integration_form_spec.js') diff --git a/spec/frontend/integrations/edit/components/integration_form_spec.js b/spec/frontend/integrations/edit/components/integration_form_spec.js index c93f63b11d0..b598a71cea8 100644 --- a/spec/frontend/integrations/edit/components/integration_form_spec.js +++ b/spec/frontend/integrations/edit/components/integration_form_spec.js @@ -3,6 +3,7 @@ import IntegrationForm from '~/integrations/edit/components/integration_form.vue import ActiveToggle from '~/integrations/edit/components/active_toggle.vue'; import JiraTriggerFields from '~/integrations/edit/components/jira_trigger_fields.vue'; import TriggerFields from '~/integrations/edit/components/trigger_fields.vue'; +import DynamicField from '~/integrations/edit/components/dynamic_field.vue'; describe('IntegrationForm', () => { let wrapper; @@ -95,5 +96,25 @@ describe('IntegrationForm', () => { expect(findTriggerFields().props('type')).toBe(type); }); }); + + describe('fields is present', () => { + it('renders DynamicField for each field', () => { + const fields = [ + { name: 'username', type: 'text' }, + { name: 'API token', type: 'password' }, + ]; + + createComponent({ + fields, + }); + + const dynamicFields = wrapper.findAll(DynamicField); + + expect(dynamicFields).toHaveLength(2); + dynamicFields.wrappers.forEach((field, index) => { + expect(field.props()).toMatchObject(fields[index]); + }); + }); + }); }); }); -- cgit v1.2.1