add relevantBlock function (#1100)

* feat: current block

* pass full rundown to functions and use filter utils
This commit is contained in:
Alex Christoffer Rasmussen
2024-07-23 12:22:47 +02:00
committed by GitHub
parent 20838c038a
commit 158ef05ff0
18 changed files with 246 additions and 49 deletions
@@ -98,6 +98,7 @@ describe('mutation on runtimeState', () => {
expect(newState.eventNow?.id).toBe(mockEvent.id);
expect(newState.timer.playback).toBe(Playback.Armed);
expect(newState.clock).not.toBe(666);
expect(newState.currentBlock.block).toBeNull();
// 2. Start event
let success = start();
@@ -171,6 +172,7 @@ describe('mutation on runtimeState', () => {
expect(newState.runtime.actualStart).toBeNull();
expect(newState.runtime.plannedStart).toBe(0);
expect(newState.runtime.plannedEnd).toBe(1500);
expect(newState.currentBlock.block).toBeNull();
// 2. Start event
start();
@@ -202,6 +204,7 @@ describe('mutation on runtimeState', () => {
expect(newState.runtime.offset).toBe(delayBefore);
// finish is the difference between the runtime and the schedule
expect(newState.runtime.expectedEnd).toBe(event2.timeEnd - newState.runtime.offset);
expect(newState.currentBlock.block).toBeNull();
// 4. Add time
addTime(10);