Commit 84e23ae0 authored by Eric Eastwood's avatar Eric Eastwood

Fix issue description syntax highlighting and math rendering

Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/33877

Regressed in
https://gitlab.com/gitlab-org/gitlab-ce/commit/5a95d6f8dae00b31b694759c6ddbf6d83b1a7890#3a15290e7696397415523e0b664aceb3dd4010ae_0_46
where the ref no longer matches what we call `renderGFM` on.
parent e4eeba4e
......@@ -53,7 +53,7 @@
},
methods: {
renderGFM() {
$(this.$refs['gfm-entry-content']).renderGFM();
$(this.$refs['gfm-content']).renderGFM();
if (this.canUpdate) {
// eslint-disable-next-line no-new
......
......@@ -96,4 +96,20 @@ describe('Description component', () => {
});
});
});
it('applies syntax highlighting and math when description changed', (done) => {
spyOn(vm, 'renderGFM').and.callThrough();
spyOn($.prototype, 'renderGFM').and.callThrough();
vm.descriptionHtml = 'changed';
Vue.nextTick(() => {
setTimeout(() => {
expect(vm.$refs['gfm-content']).toBeDefined();
expect(vm.renderGFM).toHaveBeenCalled();
expect($.prototype.renderGFM).toHaveBeenCalled();
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