react-code-dataset
/
next.js
/packages
/next
/src
/client
/components
/router-reducer
/compute-changed-path.test.ts
| import { computeChangedPath } from './compute-changed-path' | |
| describe('computeChangedPath', () => { | |
| it('should return the correct path', () => { | |
| expect( | |
| computeChangedPath( | |
| [ | |
| '', | |
| { | |
| children: [ | |
| '(marketing)', | |
| { | |
| children: ['__PAGE__', {}], | |
| modal: [ | |
| '(...)stats', | |
| { | |
| children: [ | |
| ['key', 'github', 'd'], | |
| { | |
| children: ['__PAGE__', {}], | |
| }, | |
| ], | |
| }, | |
| ], | |
| }, | |
| ], | |
| }, | |
| undefined, | |
| undefined, | |
| true, | |
| ], | |
| [ | |
| '', | |
| { | |
| children: [ | |
| '(marketing)', | |
| { | |
| children: ['__PAGE__', {}], | |
| modal: [ | |
| '(...)stats', | |
| { | |
| children: [ | |
| ['key', 'github', 'd'], | |
| { | |
| children: ['__PAGE__', {}], | |
| }, | |
| ], | |
| }, | |
| ], | |
| }, | |
| ], | |
| }, | |
| undefined, | |
| undefined, | |
| true, | |
| ] | |
| ) | |
| ).toBe('/') | |
| }) | |
| }) | |