debian-mirror-gitlab/spec/frontend/notebook/cells/output/html_spec.js

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

22 lines
530 B
JavaScript
Raw Normal View History

2021-02-22 17:27:13 +05:30
import { mount } from '@vue/test-utils';
import HtmlOutput from '~/notebook/cells/output/html.vue';
2020-10-24 23:57:45 +05:30
import sanitizeTests from './html_sanitize_fixtures';
2018-03-17 18:26:18 +05:30
describe('html output cell', () => {
function createComponent(rawCode) {
2021-02-22 17:27:13 +05:30
return mount(HtmlOutput, {
2018-03-17 18:26:18 +05:30
propsData: {
rawCode,
2019-03-02 22:35:43 +05:30
count: 0,
index: 0,
2018-03-17 18:26:18 +05:30
},
2021-02-22 17:27:13 +05:30
});
2018-03-17 18:26:18 +05:30
}
2020-10-24 23:57:45 +05:30
it.each(sanitizeTests)('sanitizes output for: %p', (name, { input, output }) => {
const vm = createComponent(input);
2018-03-17 18:26:18 +05:30
2021-02-22 17:27:13 +05:30
expect(vm.html()).toContain(output);
2018-03-17 18:26:18 +05:30
});
});