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:
Eric Eastwood 2017-06-19 15:29:46 -05:00
parent e4eeba4e4b
commit 84e23ae06c
2 changed files with 17 additions and 1 deletions

View file

@ -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

View file

@ -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();
});
});
});
});