generated from Seekra/repository-template
feat(settings): omit empty settings page segments
The composable useSettingsPage now omits empty segments in the path.
This commit is contained in:
@@ -55,7 +55,9 @@ describe('useSettingsPage', () => {
|
||||
{ path: 'a-1.#b.c/', expected: ['a-1', 'b', 'c'] },
|
||||
{ path: 'a-1.b@.c', expected: ['a-1', 'b', 'c'] },
|
||||
{ path: '....@a/#...)!&§[b.#§c..d....', expected: ['a', 'b', 'c', 'd'] },
|
||||
{ path: '....@a/#...)!&§[b.#§c..dä....', expected: ['a', 'b', 'c', 'd'] }
|
||||
{ path: '....@a/#...)!&§[b.#§c..dä....', expected: ['a', 'b', 'c', 'd'] },
|
||||
{ path: '..,...~..@a/#.+..)!&§[b.#§c..dä..)..', expected: ['a', 'b', 'c', 'd'] },
|
||||
{ path: 'a.@.b', expected: ['a', 'b'] }
|
||||
])('normalizes path correctly', async ({ path, expected }) => {
|
||||
expect(normalizePagePath(path)).toStrictEqual(expected);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user