Skip to content

Commit

Permalink
Add XRegExp polyfill to text.test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
gasman committed Apr 26, 2024
1 parent dd08333 commit dbb97b2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions 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');
Expand Down

0 comments on commit dbb97b2

Please sign in to comment.