This commit is contained in:
Filipa Lacerda 2017-08-04 19:37:02 +01:00
parent 667f8b53ee
commit a432ae9d06
3 changed files with 5 additions and 4 deletions

View file

@ -118,7 +118,7 @@
</div> </div>
<div class="flash-container timeline-content"></div> <div class="flash-container timeline-content"></div>
<form <form
class="edit-note common-note-form"> class="edit-note common-note-form js-vue-quick-submit">
<markdown-field <markdown-field
:markdown-preview-url="markdownPreviewUrl" :markdown-preview-url="markdownPreviewUrl"
:markdown-docs="markdownDocsUrl" :markdown-docs="markdownDocsUrl"

View file

@ -28,6 +28,7 @@ import '~/lib/utils/common_utils';
preloadFixtures('issues/issue_with_comment.html.raw'); preloadFixtures('issues/issue_with_comment.html.raw');
beforeEach(function(done) { beforeEach(function(done) {
loadFixtures('issues/issue_with_comment.html.raw'); loadFixtures('issues/issue_with_comment.html.raw');
$('body').data('page', 'projects:issues:show');
loadAwardsHandler(true).then((obj) => { loadAwardsHandler(true).then((obj) => {
awardsHandler = obj; awardsHandler = obj;
spyOn(awardsHandler, 'postEmoji').and.callFake((button, url, emoji, cb) => cb()); spyOn(awardsHandler, 'postEmoji').and.callFake((button, url, emoji, cb) => cb());

View file

@ -38,19 +38,19 @@ import '~/behaviors/quick_submit';
return expect(this.spies.submit).not.toHaveBeenTriggered(); return expect(this.spies.submit).not.toHaveBeenTriggered();
}); });
it('disables input of type submit', function() { it('disables input of type submit', function() {
const submitButton = $('.js-quick-submit input[type=submit]'); const submitButton = $('.js-vue-quick-submit input[type=submit]');
this.textarea.trigger(keydownEvent()); this.textarea.trigger(keydownEvent());
expect(submitButton).toBeDisabled(); expect(submitButton).toBeDisabled();
}); });
it('disables button of type submit', function() { it('disables button of type submit', function() {
const submitButton = $('.js-quick-submit input[type=submit]'); const submitButton = $('.js-vue-quick-submit input[type=submit]');
this.textarea.trigger(keydownEvent()); this.textarea.trigger(keydownEvent());
expect(submitButton).toBeDisabled(); expect(submitButton).toBeDisabled();
}); });
it('only clicks one submit', function() { it('only clicks one submit', function() {
const existingSubmit = $('.js-quick-submit input[type=submit]'); const existingSubmit = $('.js-vue-quick-submit input[type=submit]');
// Add an extra submit button // Add an extra submit button
const newSubmit = $('<button type="submit">Submit it</button>'); const newSubmit = $('<button type="submit">Submit it</button>');
newSubmit.insertAfter(this.textarea); newSubmit.insertAfter(this.textarea);