Commit a3389934 authored by Thomas Chandelle's avatar Thomas Chandelle Committed by Paul Slaughter

Set type of Web IDE commit button to submit

Also remove redundant click listener, already handle
by form submit listener

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/79259

Changelog: other
parent d967565a
......@@ -187,7 +187,7 @@ export default {
class="qa-commit-button"
category="primary"
variant="confirm"
@click="commit"
type="submit"
>
{{ __('Commit') }}
</gl-button>
......
......@@ -56,7 +56,6 @@ describe('IDE commit form', () => {
disabled: findCommitButton().props('disabled'),
tooltip: getBinding(findCommitButtonTooltip().element, 'gl-tooltip').value.title,
});
const clickCommitButton = () => findCommitButton().vm.$emit('click');
const findForm = () => wrapper.find('form');
const submitForm = () => findForm().trigger('submit');
const findCommitMessageInput = () => wrapper.find(CommitMessageField);
......@@ -283,8 +282,8 @@ describe('IDE commit form', () => {
jest.spyOn(store, 'dispatch').mockResolvedValue();
});
it.each([clickCommitButton, submitForm])('when %p, commits changes', (fn) => {
fn();
it('when submitting form, commits changes', () => {
submitForm();
expect(store.dispatch).toHaveBeenCalledWith('commit/commitChanges', undefined);
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment