diff --git a/tests/js/route.test.js b/tests/js/route.test.js index 45db4bbe..f04c7e0b 100644 --- a/tests/js/route.test.js +++ b/tests/js/route.test.js @@ -184,6 +184,10 @@ const defaultZiggy = { extension: '\\.(php|html)', }, }, + statistics: { + uri: 'статистика', + methods: ['GET', 'HEAD'], + }, pages: { uri: '{page}', methods: ['GET', 'HEAD'], @@ -1229,6 +1233,20 @@ describe('current()', () => { expect(route().current('events.venues.show', { id: 12, user: 'Matt' })).toBe(false); }); + test('can check the current route with Cyrillic characters', () => { + global.window.location.pathname = '/статистика'; + + same(route().current(), 'statistics'); + assert(route().current('statistics')); + }); + + test('can check the current route with encoded Cyrillic characters', () => { + global.window.location.pathname = '/%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0'; + + same(route().current(), 'statistics'); + assert(route().current('statistics')); + }); + test('can ignore routes that don’t allow GET requests', () => { global.window.location.pathname = '/posts/1';