Skip to content

Commit

Permalink
Add XRegExp polyfill to urlify.test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
gasman committed Apr 26, 2024
1 parent ba4430f commit bd63ab2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/src/utils/urlify.test.js
@@ -1,5 +1,10 @@
import { urlify } from './urlify';

// load window.XRegExp polyfill
import { XRegExp } from '../../../wagtail/admin/static_src/wagtailadmin/js/vendor/xregexp.min';

window.XRegExp = XRegExp;

describe('urlify', () => {
beforeAll(() => {
// load window.URLify
Expand Down Expand Up @@ -33,7 +38,7 @@ describe('urlify', () => {
expect(urlify('This & That', options)).toBe('this-that');

expect(urlify('Lisboa é ótima à beira-mar', options)).toBe(
'lisboa-e-otima-a-beira-mar',
'lisboa-é-ótima-à-beira-mar',
);
});
});
Expand Down

0 comments on commit bd63ab2

Please sign in to comment.