Commit 959ca0df authored by Paul Slaughter's avatar Paul Slaughter

Merge branch '351251-web-ide-commit-button' into 'master'

Change type of Web IDE commit button to submit

See merge request gitlab-org/gitlab!79259
parents b30f4de3 a3389934
...@@ -187,7 +187,7 @@ export default { ...@@ -187,7 +187,7 @@ export default {
class="qa-commit-button" class="qa-commit-button"
category="primary" category="primary"
variant="confirm" variant="confirm"
@click="commit" type="submit"
> >
{{ __('Commit') }} {{ __('Commit') }}
</gl-button> </gl-button>
......
...@@ -56,7 +56,6 @@ describe('IDE commit form', () => { ...@@ -56,7 +56,6 @@ describe('IDE commit form', () => {
disabled: findCommitButton().props('disabled'), disabled: findCommitButton().props('disabled'),
tooltip: getBinding(findCommitButtonTooltip().element, 'gl-tooltip').value.title, tooltip: getBinding(findCommitButtonTooltip().element, 'gl-tooltip').value.title,
}); });
const clickCommitButton = () => findCommitButton().vm.$emit('click');
const findForm = () => wrapper.find('form'); const findForm = () => wrapper.find('form');
const submitForm = () => findForm().trigger('submit'); const submitForm = () => findForm().trigger('submit');
const findCommitMessageInput = () => wrapper.find(CommitMessageField); const findCommitMessageInput = () => wrapper.find(CommitMessageField);
...@@ -283,8 +282,8 @@ describe('IDE commit form', () => { ...@@ -283,8 +282,8 @@ describe('IDE commit form', () => {
jest.spyOn(store, 'dispatch').mockResolvedValue(); jest.spyOn(store, 'dispatch').mockResolvedValue();
}); });
it.each([clickCommitButton, submitForm])('when %p, commits changes', (fn) => { it('when submitting form, commits changes', () => {
fn(); submitForm();
expect(store.dispatch).toHaveBeenCalledWith('commit/commitChanges', undefined); 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