-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: extract utilities and types * refactor: extract and simplify progress bar logic * refactor: duration validation handles midnight * fix: prevent stale event loader * refactor: consider next event in timer invalidation * refactor: reload changes on changed roll target * refactor: timer load accounts for midnight * fix: issues with midnight on roll * refactor: prevent stale secondary event
- Loading branch information
Showing
28 changed files
with
499 additions
and
250 deletions.
There are no files selected for viewing
27 changes: 0 additions & 27 deletions
27
apps/client/src/common/utils/__tests__/timesManager.test.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
apps/client/src/features/event-editor/composite/EventEditorTimes.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
apps/client/src/features/rundown/event-block/composite/EventBlockTimers.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...client/src/features/rundown/event-block/composite/__tests__/EventBlockProgressBar.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { dayInMs } from 'ontime-utils'; | ||
|
||
import { getPercentComplete } from '../EventBlockProgressBar'; | ||
|
||
describe('getPercentComplete()', () => { | ||
describe('calculates progress in normal cases', () => { | ||
const testScenarios = [ | ||
{ current: 0, duration: 0, expect: 100 }, | ||
{ current: 0, duration: 100, expect: 100 }, | ||
{ current: 0, duration: dayInMs, expect: 100 }, | ||
{ current: 10, duration: 100, expect: 90 }, | ||
{ current: 50, duration: 100, expect: 50 }, | ||
{ current: 100, duration: 100, expect: 0 }, | ||
]; | ||
|
||
testScenarios.forEach((testCase) => { | ||
it(`handles ${testCase.current} / ${testCase.duration}`, () => { | ||
const progress = getPercentComplete(testCase.current, testCase.duration); | ||
expect(progress).toBe(testCase.expect); | ||
}); | ||
}); | ||
}); | ||
it('is 0 if we dont have a current or duration', () => { | ||
const progress = getPercentComplete(null, null); | ||
expect(progress).toBe(0); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.