Skip to content

Commit 97ce303

Browse files
committed
test: adjust tests for updated DOMpurify
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 326cd98 commit 97ce303

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

tests/OC.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default {
2020
Util: {
2121
naturalSortCompare(a, b) {
2222
return 0
23-
}
23+
},
2424
},
2525

2626
coreApps: [

tests/unit/components/NcIconSvgWrapper/NcIconSvgWrapper.spec.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ import { shallowMount } from '@vue/test-utils'
77
import NcIconSvgWrapper from '../../../../src/components/NcIconSvgWrapper/index.js'
88

99
// @mdi/check.svg
10-
const SVG_ICON = '<svg xmlns="http://www.w3.org/2000/svg" id="mdi-check" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" /></svg>'
11-
12-
const SVG_ICON_SNAPSHOT = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
13-
<path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path>
14-
</svg>`
10+
const SVG_ICON
11+
= '<svg xmlns="http://www.w3.org/2000/svg" id="mdi-check" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" /></svg>'
1512

1613
/**
1714
* @param {NcIconSvgWrapper.props} propsData - NcIconSvgWrapper.props
@@ -25,7 +22,11 @@ describe('NcIconSvgWrapper', () => {
2522
const wrapper = mountNcIconSvgWrapper({ svg: SVG_ICON })
2623
const svg = wrapper.find('svg')
2724
expect(svg.exists()).toBeTruthy()
28-
expect(svg.html()).toBe(SVG_ICON_SNAPSHOT)
25+
expect(svg.html()).toMatchInlineSnapshot(`
26+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
27+
<path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path>
28+
</svg>
29+
`)
2930
})
3031

3132
it('should render SVG in a span with aria-hidden when no name is provided', () => {

0 commit comments

Comments
 (0)