mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 14:14:17 +00:00
refactor: mask cuesheet presets
This commit is contained in:
committed by
Carlos Valente
parent
1c81b3a23c
commit
6268e327b9
@@ -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()', () => {
|
||||
|
||||
Reference in New Issue
Block a user