Fix issue description syntax highlighting and math rendering
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/33877
Regressed in
5a95d6f8da (3a15290e7696397415523e0b664aceb3dd4010ae_0_46)
where the ref no longer matches what we call `renderGFM` on.
This commit is contained in:
parent
e4eeba4e4b
commit
84e23ae06c
2 changed files with 17 additions and 1 deletions
|
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue