Skip to content

Commit

Permalink
test: add a test to ensure / path is same as empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Jun 9, 2024
1 parent 52a3234 commit 25e834b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/core/src/__tests__/getStateFromPath.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2801,3 +2801,20 @@ it('resolves nested path params with same name to correct screen', () => {

expect(getStateFromPath<object>(path, config)).toEqual(state);
});

it('parses / same as empty string', () => {
const config = {
screens: {
Foo: {
path: '/',
},
Bar: {
path: 'bar',
},
},
};

expect(getStateFromPath<object>('/', config)).toEqual(
getStateFromPath<object>('', config)
);
});

0 comments on commit 25e834b

Please sign in to comment.