Commit aea013ea authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Clement Ho

Move NoteApp tests to Jest

parent 8a2afff0
import $ from 'jquery'; import $ from 'jquery';
import 'at.js';
import _ from 'underscore'; import _ from 'underscore';
import glRegexp from './lib/utils/regexp'; import glRegexp from './lib/utils/regexp';
import AjaxCache from './lib/utils/ajax_cache'; import AjaxCache from './lib/utils/ajax_cache';
......
...@@ -10,7 +10,7 @@ import Flash from '../../flash'; ...@@ -10,7 +10,7 @@ import Flash from '../../flash';
import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue'; import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
import noteHeader from './note_header.vue'; import noteHeader from './note_header.vue';
import noteActions from './note_actions.vue'; import noteActions from './note_actions.vue';
import noteBody from './note_body.vue'; import NoteBody from './note_body.vue';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
import noteable from '../mixins/noteable'; import noteable from '../mixins/noteable';
import resolvable from '../mixins/resolvable'; import resolvable from '../mixins/resolvable';
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
userAvatarLink, userAvatarLink,
noteHeader, noteHeader,
noteActions, noteActions,
noteBody, NoteBody,
TimelineEntryItem, TimelineEntryItem,
}, },
mixins: [noteable, resolvable, draftMixin], mixins: [noteable, resolvable, draftMixin],
...@@ -209,7 +209,10 @@ export default { ...@@ -209,7 +209,10 @@ export default {
// we need to do this to prevent noteForm inconsistent content warning // we need to do this to prevent noteForm inconsistent content warning
// this is something we intentionally do so we need to recover the content // this is something we intentionally do so we need to recover the content
this.note.note = noteText; this.note.note = noteText;
this.$refs.noteBody.note.note = noteText; const { noteBody } = this.$refs;
if (noteBody) {
noteBody.note.note = noteText;
}
}, },
}, },
}; };
......
...@@ -127,6 +127,9 @@ export default { ...@@ -127,6 +127,9 @@ export default {
initUserPopovers(this.$el.querySelectorAll('.js-user-link')); initUserPopovers(this.$el.querySelectorAll('.js-user-link'));
}); });
}, },
beforeDestroy() {
this.stopPolling();
},
methods: { methods: {
...mapActions([ ...mapActions([
'setLoadingState', 'setLoadingState',
...@@ -144,6 +147,7 @@ export default { ...@@ -144,6 +147,7 @@ export default {
'expandDiscussion', 'expandDiscussion',
'startTaskList', 'startTaskList',
'convertToDiscussion', 'convertToDiscussion',
'stopPolling',
]), ]),
fetchNotes() { fetchNotes() {
if (this.isFetching) return null; if (this.isFetching) return null;
......
import $ from 'jquery';
global.$ = $;
global.jQuery = $;
export default $;
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