BigW Consortium Gitlab

Commit 551c708c by Fatih Acet

Merge branch 'disable-issue-action-button-if-isSubmitting' into 'master'

Disable issue action button whilst submitting and test See merge request gitlab-org/gitlab-ce!15211
parents 1bf68956 8ba88006
......@@ -357,7 +357,8 @@
@click="handleSave(true)"
v-if="canUpdateIssue"
:class="actionButtonClassNames"
class="btn btn-comment btn-comment-and-close">
:disabled="isSubmitting"
class="btn btn-comment btn-comment-and-close js-action-button">
{{issueActionButtonTitle}}
</button>
<button
......
......@@ -55,6 +55,25 @@ describe('issue_comment_form component', () => {
expect(vm.toggleIssueState).toHaveBeenCalled();
});
it('should disable action button whilst submitting', (done) => {
const saveNotePromise = Promise.resolve();
vm.note = 'hello world';
spyOn(vm, 'saveNote').and.returnValue(saveNotePromise);
spyOn(vm, 'stopPolling');
const actionButton = vm.$el.querySelector('.js-action-button');
vm.handleSave();
Vue.nextTick()
.then(() => expect(actionButton.disabled).toBeTruthy())
.then(saveNotePromise)
.then(Vue.nextTick)
.then(() => expect(actionButton.disabled).toBeFalsy())
.then(done)
.catch(done.fail);
});
});
describe('textarea', () => {
......
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