Commit 3bd289c1 authored by Winnie Hellmann's avatar Winnie Hellmann

Clean up note_form_spec.js after bad merge

parent 1f682bf0
...@@ -113,8 +113,7 @@ describe('issue_note_form component', () => { ...@@ -113,8 +113,7 @@ describe('issue_note_form component', () => {
it('should ender edit mode', () => { it('should ender edit mode', () => {
// TODO: do not spy on vm // TODO: do not spy on vm
spyOn(wrapper.vm, 'editMyLastNote').and.callThrough(); spyOn(wrapper.vm, 'editMyLastNote').and.callThrough();
textarea = wrapper.find('textarea');
textarea.setValue('Foo');
textarea.trigger('keydown.up'); textarea.trigger('keydown.up');
expect(wrapper.vm.editMyLastNote).toHaveBeenCalled(); expect(wrapper.vm.editMyLastNote).toHaveBeenCalled();
...@@ -123,8 +122,6 @@ describe('issue_note_form component', () => { ...@@ -123,8 +122,6 @@ describe('issue_note_form component', () => {
describe('enter', () => { describe('enter', () => {
it('should save note when cmd+enter is pressed', () => { it('should save note when cmd+enter is pressed', () => {
textarea = wrapper.find('textarea');
textarea.setValue('Foo');
textarea.trigger('keydown.enter', { metaKey: true }); textarea.trigger('keydown.enter', { metaKey: true });
const { handleFormUpdate } = wrapper.emitted(); const { handleFormUpdate } = wrapper.emitted();
...@@ -133,8 +130,6 @@ describe('issue_note_form component', () => { ...@@ -133,8 +130,6 @@ describe('issue_note_form component', () => {
}); });
it('should save note when ctrl+enter is pressed', () => { it('should save note when ctrl+enter is pressed', () => {
textarea = wrapper.find('textarea');
textarea.setValue('Foo');
textarea.trigger('keydown.enter', { ctrlKey: true }); textarea.trigger('keydown.enter', { ctrlKey: true });
const { handleFormUpdate } = wrapper.emitted(); const { handleFormUpdate } = wrapper.emitted();
...@@ -158,9 +153,7 @@ describe('issue_note_form component', () => { ...@@ -158,9 +153,7 @@ describe('issue_note_form component', () => {
.then(() => { .then(() => {
const cancelButton = wrapper.find('.note-edit-cancel'); const cancelButton = wrapper.find('.note-edit-cancel');
cancelButton.trigger('click'); cancelButton.trigger('click');
return wrapper.vm.$nextTick();
})
.then(() => {
expect(wrapper.vm.cancelHandler).toHaveBeenCalled(); expect(wrapper.vm.cancelHandler).toHaveBeenCalled();
}) })
.then(done) .then(done)
...@@ -180,9 +173,7 @@ describe('issue_note_form component', () => { ...@@ -180,9 +173,7 @@ describe('issue_note_form component', () => {
textarea.setValue('Foo'); textarea.setValue('Foo');
const saveButton = wrapper.find('.js-vue-issue-save'); const saveButton = wrapper.find('.js-vue-issue-save');
saveButton.trigger('click'); saveButton.trigger('click');
return wrapper.vm.$nextTick();
})
.then(() => {
expect(wrapper.vm.isSubmitting).toEqual(true); expect(wrapper.vm.isSubmitting).toEqual(true);
}) })
.then(done) .then(done)
......
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