summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gascou-Vaillancourt <paul.gascvail@gmail.com>2019-06-04 16:07:36 -0400
committerPaul Gascou-Vaillancourt <paul.gascvail@gmail.com>2019-06-04 16:16:45 -0400
commit0e4033860ba59a48eab041fd6fca0cf8a30c9c9b (patch)
treea2d02126d1b2b1702b86ad8e207999e287451597
parent327cae1da7f91256629fc59cfd4e4c97fd77366a (diff)
downloadgitlab-ce-0e4033860ba59a48eab041fd6fca0cf8a30c9c9b.tar.gz
Fix submit button selector in specs
-rw-r--r--spec/frontend/operation_settings/components/external_dashboard_spec.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/frontend/operation_settings/components/external_dashboard_spec.js b/spec/frontend/operation_settings/components/external_dashboard_spec.js
index 986aada0b03..a881de8fbfe 100644
--- a/spec/frontend/operation_settings/components/external_dashboard_spec.js
+++ b/spec/frontend/operation_settings/components/external_dashboard_spec.js
@@ -114,6 +114,8 @@ describe('operation settings external dashboard component', () => {
});
describe('submit button', () => {
+ const findSubmitButton = () => wrapper.find('.settings-content form').find(GlButton);
+
const endpointRequest = [
operationsSettingsEndpoint,
{
@@ -127,14 +129,14 @@ describe('operation settings external dashboard component', () => {
it('renders button label', () => {
mountComponent();
- const submit = wrapper.find(GlButton);
+ const submit = findSubmitButton();
expect(submit.text()).toBe('Save Changes');
});
it('submits form on click', () => {
mountComponent(false);
axios.patch.mockResolvedValue();
- wrapper.find(GlButton).trigger('click');
+ findSubmitButton().trigger('click');
expect(axios.patch).toHaveBeenCalledWith(...endpointRequest);
@@ -145,7 +147,7 @@ describe('operation settings external dashboard component', () => {
mountComponent(false);
const message = 'mockErrorMessage';
axios.patch.mockRejectedValue({ response: { data: { message } } });
- wrapper.find(GlButton).trigger('click');
+ findSubmitButton().trigger('click');
expect(axios.patch).toHaveBeenCalledWith(...endpointRequest);