Skip to content

Commit

Permalink
chore: add Router#{url,path} query params feature test (ZijianHe#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
wachunei committed May 27, 2018
1 parent c0e9e08 commit dc13b50
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/url.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ test('static - produces a path', t => {
t.is(path, '/users');
});

test('static - produces a path with query paramaters', t => {
const path = Router.path('/users', { role: 'admin', limit: '10' });

t.is(path, '/users?role=admin&limit=10');
});

test('static - produces a path with params', t => {
const path = Router.path('/users/:id/photos/:tag', { id: 1, tag: 'me' });

Expand Down

0 comments on commit dc13b50

Please sign in to comment.