BigW Consortium Gitlab

highlight_spec.js 467 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
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);

    expect(el.querySelector('.s')).not.toBeNull();
    expect(el.querySelector('.nf')).not.toBeNull();
  });
});