mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 04:43:35 +00:00
0e6d6cd416
* refactor: allow secondary rundowns * ui: move dropdown * feat: follow loaded * ui: background edit warning ui: fix disable radio button * feat(ui): add loaded sufix in the rundown list * feat(ui): add direct link to background edit from rundown manager * fix: better fallback * fix: default to is isCurrentRundown for nav bar colour * chore: rename navigate to cuesheet --------- Co-authored-by: alex-arc <ac@omnivox.dk>
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { AppMode } from '../../../ontimeConfig';
|
|
import { getEffectiveCuesheetMode } from '../useApplyCuesheetPolicy';
|
|
|
|
describe('getEffectiveCuesheetMode()', () => {
|
|
it('honors the stored mode when the user can change mode on the current rundown', () => {
|
|
const permissions = { canChangeMode: true };
|
|
|
|
expect(getEffectiveCuesheetMode(permissions, AppMode.Edit, { canRunMode: true })).toBe(AppMode.Edit);
|
|
expect(getEffectiveCuesheetMode(permissions, AppMode.Run, { canRunMode: true })).toBe(AppMode.Run);
|
|
});
|
|
|
|
it('forces Run mode when the preset forbids mode changes', () => {
|
|
const permissions = { canChangeMode: false };
|
|
|
|
expect(getEffectiveCuesheetMode(permissions, AppMode.Edit, { canRunMode: true })).toBe(AppMode.Run);
|
|
});
|
|
|
|
it('forces Edit mode for background rundowns without changing the permission policy', () => {
|
|
const permissions = { canChangeMode: true };
|
|
|
|
expect(getEffectiveCuesheetMode(permissions, AppMode.Run, { canRunMode: false })).toBe(AppMode.Edit);
|
|
});
|
|
});
|