diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-17 16:05:49 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-17 16:05:49 +0000 |
commit | 43a25d93ebdabea52f99b05e15b06250cd8f07d7 (patch) | |
tree | dceebdc68925362117480a5d672bcff122fb625b /spec/frontend/lib/dompurify_spec.js | |
parent | 20c84b99005abd1c82101dfeff264ac50d2df211 (diff) | |
download | gitlab-ce-16.0.0-rc42.tar.gz |
Add latest changes from gitlab-org/gitlab@16-0-stable-eev16.0.0-rc4216-0-stable
Diffstat (limited to 'spec/frontend/lib/dompurify_spec.js')
-rw-r--r-- | spec/frontend/lib/dompurify_spec.js | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/spec/frontend/lib/dompurify_spec.js b/spec/frontend/lib/dompurify_spec.js index f767a673553..fdc8789c1a8 100644 --- a/spec/frontend/lib/dompurify_spec.js +++ b/spec/frontend/lib/dompurify_spec.js @@ -49,8 +49,6 @@ const forbiddenDataAttrs = defaultConfig.FORBID_ATTR; const acceptedDataAttrs = ['data-random', 'data-custom']; describe('~/lib/dompurify', () => { - let originalGon; - it('uses local configuration when given', () => { // As dompurify uses a "Persistent Configuration", it might // ignore config, this check verifies we respect @@ -104,15 +102,10 @@ describe('~/lib/dompurify', () => { ${'root'} | ${rootGon} ${'absolute'} | ${absoluteGon} `('when gon contains $type icon urls', ({ type, gon }) => { - beforeAll(() => { - originalGon = window.gon; + beforeEach(() => { window.gon = gon; }); - afterAll(() => { - window.gon = originalGon; - }); - it('allows no href attrs', () => { const htmlHref = `<svg><use></use></svg>`; expect(sanitize(htmlHref)).toBe(htmlHref); @@ -137,14 +130,9 @@ describe('~/lib/dompurify', () => { describe('when gon does not contain icon urls', () => { beforeAll(() => { - originalGon = window.gon; window.gon = {}; }); - afterAll(() => { - window.gon = originalGon; - }); - it.each([...safeUrls.root, ...safeUrls.absolute, ...unsafeUrls])('sanitizes URL %s', (url) => { const htmlHref = `<svg><use href="${url}"></use></svg>`; const htmlXlink = `<svg><use xlink:href="${url}"></use></svg>`; |