Commit 7065bb3e authored by Filipa Lacerda's avatar Filipa Lacerda

Fix vue broken test

parent c28df4bc
......@@ -218,8 +218,10 @@
:img-size="40"
/>
</div>
<div class="js-main-target-form timeline-content timeline-content-form common-note-form">
<form>
<div >
<form
class="js-main-target-form timeline-content timeline-content-form common-note-form"
@submit="handleSave(true)">
<markdown-field
:markdown-preview-url="markdownPreviewUrl"
:markdown-docs="markdownDocsUrl"
......@@ -228,7 +230,7 @@
<textarea
id="note-body"
name="note[note]"
class="note-textarea js-gfm-input markdown-area"
class="note-textarea js-gfm-input js-autosize markdown-area"
data-supports-quick-actions="true"
aria-label="Description"
v-model="note"
......@@ -300,8 +302,7 @@
</ul>
</div>
<button
type="button"
@click="handleSave(true)"
type="submit"
v-if="canUpdateIssue"
:class="actionButtonClassNames"
class="btn btn-nr btn-comment btn-comment-and-close">
......
......@@ -118,7 +118,8 @@
</div>
<div class="flash-container timeline-content"></div>
<form
class="edit-note common-note-form js-vue-quick-submit">
class="edit-note common-note-form"
@submit="handleUpdate">
<markdown-field
:markdown-preview-url="markdownPreviewUrl"
:markdown-docs="markdownDocsUrl"
......@@ -141,8 +142,7 @@
</markdown-field>
<div class="note-form-actions clearfix">
<button
type="button"
@click="handleUpdate"
type="submit"
:disabled="isDisabled"
class="btn btn-nr btn-save">
{{saveButtonTitle}}
......
......@@ -38,19 +38,19 @@ import '~/behaviors/quick_submit';
return expect(this.spies.submit).not.toHaveBeenTriggered();
});
it('disables input of type submit', function() {
const submitButton = $('.js-vue-quick-submit input[type=submit]');
const submitButton = $('.js-quick-submit input[type=submit]');
this.textarea.trigger(keydownEvent());
expect(submitButton).toBeDisabled();
});
it('disables button of type submit', function() {
const submitButton = $('.js-vue-quick-submit input[type=submit]');
const submitButton = $('.js-quick-submit input[type=submit]');
this.textarea.trigger(keydownEvent());
expect(submitButton).toBeDisabled();
});
it('only clicks one submit', function() {
const existingSubmit = $('.js-vue-quick-submit input[type=submit]');
const existingSubmit = $('.js-quick-submit input[type=submit]');
// Add an extra submit button
const newSubmit = $('<button type="submit">Submit it</button>');
newSubmit.insertAfter(this.textarea);
......
......@@ -18,8 +18,7 @@ describe('issue placeholder system note component', () => {
it('should render system note placeholder with plain text', () => {
const vm = mountComponent('This is a placeholder');
expect(vm.$el.tagName).toEqua('LI');
expect(vm.$el.querySelector('.timeline-content i').textContent.trim()).toEqua('This is a placeholder');
expect(vm.$el.tagName).toEqual('LI');
expect(vm.$el.querySelector('.timeline-content em').textContent.trim()).toEqual('This is a placeholder');
});
});
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