refactor: mask cuesheet presets

This commit is contained in:
Carlos Valente
2026-02-19 16:01:55 +01:00
committed by Carlos Valente
parent 1c81b3a23c
commit 6268e327b9
3 changed files with 54 additions and 1 deletions
@@ -82,6 +82,31 @@ describe('getRouteFromPreset()', () => {
expect(getRouteFromPreset(location, presets)).toBe('timer?user=guest&alias=demopage&n=1&token=123');
});
});
describe('cuesheet preset options', () => {
const cuesheetPreset: URLPreset[] = [
{
enabled: true,
alias: 'cuesheet-4685d6',
target: OntimeView.Cuesheet,
search: '',
options: {
read: 'full',
write: '-',
},
},
];
it('keeps cuesheet aliases masked when permissions are stored in preset options', () => {
const location = resolvePath('/cuesheet-4685d6');
expect(getRouteFromPreset(location, cuesheetPreset)).toBe('preset/cuesheet-4685d6');
});
it('preserves feature params when redirecting masked cuesheet aliases', () => {
const location = resolvePath('/cuesheet-4685d6?n=1&token=123');
expect(getRouteFromPreset(location, cuesheetPreset)).toBe('preset/cuesheet-4685d6?n=1&token=123');
});
});
});
describe('generatePathFromPreset()', () => {