Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerkretzmar committed Oct 6, 2023
1 parent 711d30f commit 5dfe3ae
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/js/route.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ const defaultZiggy = {
extension: '\\.(php|html)',
},
},
statistics: {
uri: 'статистика',
methods: ['GET', 'HEAD'],
},
pages: {
uri: '{page}',
methods: ['GET', 'HEAD'],
Expand Down Expand Up @@ -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';

Expand Down

0 comments on commit 5dfe3ae

Please sign in to comment.