debian-mirror-gitlab/spec/frontend/notebook/lib/highlight_spec.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
478 B
JavaScript
Raw Normal View History

2017-08-17 22:00:37 +05:30
import Prism from '~/notebook/lib/highlight';
describe('Highlight library', () => {
it('imports python language', () => {
expect(Prism.languages.python).toBeDefined();
});
it('uses custom CSS classes', () => {
const el = document.createElement('div');
el.innerHTML = Prism.highlight('console.log("a");', Prism.languages.javascript);
2021-02-22 17:27:13 +05:30
expect(el.querySelector('.string')).not.toBeNull();
expect(el.querySelector('.function')).not.toBeNull();
2017-08-17 22:00:37 +05:30
});
});