diff options
author | kushalpandya <kushal@gitlab.com> | 2017-05-31 12:48:02 +0530 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-06-01 07:47:16 +0200 |
commit | dc3de71fb79e1b9bb72eb9cf283fb94d7a089c90 (patch) | |
tree | d1ab91f8e032b1a06938d886ee9dfe3b306ab61b /spec/javascripts | |
parent | 576e30ee60f02c8af4cc50e3cc44b9f519e89170 (diff) | |
download | gitlab-ce-dc3de71fb79e1b9bb72eb9cf283fb94d7a089c90.tar.gz |
Update tests based on source changes
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/integrations/integration_settings_form_spec.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/spec/javascripts/integrations/integration_settings_form_spec.js b/spec/javascripts/integrations/integration_settings_form_spec.js index a8ee7db6432..e2a8259dea9 100644 --- a/spec/javascripts/integrations/integration_settings_form_spec.js +++ b/spec/javascripts/integrations/integration_settings_form_spec.js @@ -29,7 +29,7 @@ describe('IntegrationSettingsForm', () => { }); it('should initialize form metadata on class object', () => { - expect(integrationSettingsForm.endPoint).toBeDefined(); + expect(integrationSettingsForm.testEndPoint).toBeDefined(); expect(integrationSettingsForm.canTestService).toBeDefined(); }); }); @@ -62,22 +62,25 @@ describe('IntegrationSettingsForm', () => { }); it('should set Save button label to "Test settings and save changes" when serviceActive & canTestService are `true`', () => { - integrationSettingsForm.toggleSubmitBtnLabel(true, true); + integrationSettingsForm.canTestService = true; + integrationSettingsForm.toggleSubmitBtnLabel(true); expect(integrationSettingsForm.$submitBtnLabel.text()).toEqual('Test settings and save changes'); }); it('should set Save button label to "Save changes" when either serviceActive or canTestService (or both) is `false`', () => { - integrationSettingsForm.toggleSubmitBtnLabel(false, false); + integrationSettingsForm.canTestService = false; + integrationSettingsForm.toggleSubmitBtnLabel(false); expect(integrationSettingsForm.$submitBtnLabel.text()).toEqual('Save changes'); - integrationSettingsForm.toggleSubmitBtnLabel(false, true); - + integrationSettingsForm.toggleSubmitBtnLabel(true); expect(integrationSettingsForm.$submitBtnLabel.text()).toEqual('Save changes'); - integrationSettingsForm.toggleSubmitBtnLabel(true, false); + integrationSettingsForm.canTestService = true; + + integrationSettingsForm.toggleSubmitBtnLabel(false); expect(integrationSettingsForm.$submitBtnLabel.text()).toEqual('Save changes'); }); }); @@ -121,7 +124,7 @@ describe('IntegrationSettingsForm', () => { expect($.ajax).toHaveBeenCalledWith({ type: 'PUT', - url: `${integrationSettingsForm.endPoint}/test`, + url: integrationSettingsForm.testEndPoint, data: formData, }); }); |