From dbb97b27efaabe63f63d18f54b64fc4fc992ddee Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Fri, 26 Apr 2024 12:50:53 +0100 Subject: [PATCH] Add XRegExp polyfill to text.test.js --- client/src/utils/text.test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/src/utils/text.test.js b/client/src/utils/text.test.js index 06a257929a2..00595b6484e 100644 --- a/client/src/utils/text.test.js +++ b/client/src/utils/text.test.js @@ -1,5 +1,10 @@ import { cleanForSlug, escapeHtml } from './text'; +// load window.XRegExp polyfill +import { XRegExp } from '../../../wagtail/admin/static_src/wagtailadmin/js/vendor/xregexp.min'; + +window.XRegExp = XRegExp; + describe('escapeHtml', () => { it('should escape the supplied HTML', () => { expect(escapeHtml('7 is > than 5 & 3')).toEqual('7 is > than 5 & 3');