feat(settings): add page path normalization type check

Added a type check to the normalizePagePath function. The function now
returns an empty array if the path is not a string.
This commit is contained in:
2026-07-27 19:05:05 +02:00
parent e14ce45849
commit 72c88838cb
2 changed files with 7 additions and 1 deletions
@@ -57,7 +57,12 @@ describe('useSettingsPage', () => {
{ 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'] }
{ path: 'a.@.b', expected: ['a', 'b'] },
{ path: 1, expected: [] },
{ path: false, expected: [] },
{ path: true, expected: [] },
{ path: null, expected: [] },
{ path: undefined, expected: [] }
])('normalizes path correctly', async ({ path, expected }) => {
expect(normalizePagePath(path)).toStrictEqual(expected);
});