diff options
Diffstat (limited to 'spec/frontend/notebook/cells/output/html_spec.js')
-rw-r--r-- | spec/frontend/notebook/cells/output/html_spec.js | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/spec/frontend/notebook/cells/output/html_spec.js b/spec/frontend/notebook/cells/output/html_spec.js index 3ee404fb187..48d62d74a50 100644 --- a/spec/frontend/notebook/cells/output/html_spec.js +++ b/spec/frontend/notebook/cells/output/html_spec.js @@ -1,6 +1,6 @@ import Vue from 'vue'; import htmlOutput from '~/notebook/cells/output/html.vue'; -import sanitizeTests from './html_sanitize_tests'; +import sanitizeTests from './html_sanitize_fixtures'; describe('html output cell', () => { function createComponent(rawCode) { @@ -15,17 +15,12 @@ describe('html output cell', () => { }).$mount(); } - describe('sanitizes output', () => { - Object.keys(sanitizeTests).forEach(key => { - it(key, () => { - const test = sanitizeTests[key]; - const vm = createComponent(test.input); - const outputEl = [...vm.$el.querySelectorAll('div')].pop(); + it.each(sanitizeTests)('sanitizes output for: %p', (name, { input, output }) => { + const vm = createComponent(input); + const outputEl = [...vm.$el.querySelectorAll('div')].pop(); - expect(outputEl.innerHTML).toEqual(test.output); + expect(outputEl.innerHTML).toEqual(output); - vm.$destroy(); - }); - }); + vm.$destroy(); }); }); |