Fix broken markdown field test
This commit is contained in:
parent
c7dbba8bf1
commit
a3cf3e5074
|
@ -64,12 +64,11 @@
|
||||||
.then(resp => resp.json())
|
.then(resp => resp.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
this.markdownPreviewLoading = false;
|
this.markdownPreviewLoading = false;
|
||||||
this.markdownPreview = data.body;
|
this.markdownPreview = data.body || 'Nothing to preview.';
|
||||||
this.referencedCommands = data.references.commands;
|
|
||||||
this.referencedUsers = data.references.users;
|
|
||||||
|
|
||||||
if (!this.markdownPreview) {
|
if (data.references) {
|
||||||
this.markdownPreview = 'Nothing to preview.';
|
this.referencedCommands = data.references.commands;
|
||||||
|
this.referencedUsers = data.references.users;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|
|
@ -92,6 +92,7 @@ describe('Markdown field component', () => {
|
||||||
|
|
||||||
it('renders GFM with jQuery', (done) => {
|
it('renders GFM with jQuery', (done) => {
|
||||||
spyOn($.fn, 'renderGFM');
|
spyOn($.fn, 'renderGFM');
|
||||||
|
|
||||||
previewLink.click();
|
previewLink.click();
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -100,7 +101,7 @@ describe('Markdown field component', () => {
|
||||||
).toHaveBeenCalled();
|
).toHaveBeenCalled();
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
}, 0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue