Fix broken markdown field test

This commit is contained in:
Filipa Lacerda 2017-08-11 21:43:33 +01:00
parent c7dbba8bf1
commit a3cf3e5074
2 changed files with 6 additions and 6 deletions

View File

@ -64,12 +64,11 @@
.then(resp => resp.json())
.then((data) => {
this.markdownPreviewLoading = false;
this.markdownPreview = data.body;
this.referencedCommands = data.references.commands;
this.referencedUsers = data.references.users;
this.markdownPreview = data.body || 'Nothing to preview.';
if (!this.markdownPreview) {
this.markdownPreview = 'Nothing to preview.';
if (data.references) {
this.referencedCommands = data.references.commands;
this.referencedUsers = data.references.users;
}
this.$nextTick(() => {

View File

@ -92,6 +92,7 @@ describe('Markdown field component', () => {
it('renders GFM with jQuery', (done) => {
spyOn($.fn, 'renderGFM');
previewLink.click();
setTimeout(() => {
@ -100,7 +101,7 @@ describe('Markdown field component', () => {
).toHaveBeenCalled();
done();
});
}, 0);
});
});