Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Commit

Permalink
test(lib): add one test for forwardParams
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsisexistence committed Jun 21, 2019
1 parent 31b35ab commit c789ddf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- fixed issues with typing of getter functions
- covered with tests all api


# 2.1.2 2019-06-17

- improved documentation
Expand Down
7 changes: 7 additions & 0 deletions package/src/functions/forward-params.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,11 @@ describe('forwardParams', () => {
const state = forwardParams(appSlice.map.state, { map: 'world' });
expect(state).toEqual(['/', 'maps', 'world']);
});

it('should return new parameterized state with reverted the same double path', () => {
const appRoutes: Routes = [{ path: ':map/map' }];
const appSlice = createRoot(appRoutes);
const state = forwardParams(appSlice.map.state, { map: 'world' });
expect(state).toEqual(['/', 'world', 'map']);
});
});

0 comments on commit c789ddf

Please sign in to comment.