mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 00:46:45 +00:00
test(e2e): stabilize repeat-task-day-change test against CI timer throttling
The day-change emission in GlobalTrackingIntervalService has three real-world paths: 1s interval, window:focus, visibilitychange. Under CI load the 1s setInterval can starve past the 30s assertion window. Dispatch a focus event after the clock advance to trigger focusBased$ (debounced 100ms), exercising the same addAllDueToday() chain deterministically.
This commit is contained in:
parent
34f45b11bc
commit
46ac873570
1 changed files with 7 additions and 0 deletions
|
|
@ -71,6 +71,13 @@ test.describe('Repeat Task - Day Change (#6230)', () => {
|
|||
// 7. Advance clock past midnight to Day X+1
|
||||
await page.clock.setFixedTime(new Date('2026-06-16T00:05:00'));
|
||||
|
||||
// The day-change emission has two real-world paths in GlobalTrackingIntervalService:
|
||||
// the 1s `interval` (timerBased$) and `window:focus` / `visibilitychange`.
|
||||
// CI runners have enough CPU contention that the 1s tick can lag past the 30s
|
||||
// wait window. Dispatching a focus event triggers focusBased$ (debounced 100ms)
|
||||
// immediately, exercising the same effect chain deterministically.
|
||||
await page.evaluate(() => window.dispatchEvent(new Event('focus')));
|
||||
|
||||
// 8. Assert: a new undone task with the same title should appear
|
||||
// The app's date-change mechanism should detect the new day and create
|
||||
// a fresh repeat task instance. 30s timeout accounts for debounce + sync.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue