mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-08-01 12:10:33 +00:00
Co-authored-by: p1 <giridharpavan593@gmail.com>
This commit is contained in:
parent
b26fb1093f
commit
e1d15212ff
1 changed files with 13 additions and 0 deletions
13
src/test.ts
13
src/test.ts
|
|
@ -25,6 +25,7 @@ import 'fake-indexeddb/auto';
|
|||
import { IDBFactory } from 'fake-indexeddb';
|
||||
import { asyncScheduler } from 'rxjs';
|
||||
import { clearDeferredActions } from './app/op-log/capture/operation-capture.meta-reducer';
|
||||
import { _resetDevErrorState } from './app/util/dev-error';
|
||||
|
||||
import { getTestBed, TestBed } from '@angular/core/testing';
|
||||
import {
|
||||
|
|
@ -108,6 +109,18 @@ beforeEach(() => {
|
|||
// the phantom-change guard (#8751) reads it and silently skips compaction
|
||||
// and snapshot saves — an order-dependent failure that passes standalone.
|
||||
clearDeferredActions();
|
||||
|
||||
// The dialog spies below are created once at module load, so reset their
|
||||
// call history before every spec to prevent assertions from passing on a
|
||||
// stale call from an unrelated test. Re-arm devError's alert latch as well
|
||||
// so legitimate alerts remain observable regardless of spec order.
|
||||
if (jasmine.isSpy(window.alert)) {
|
||||
(window.alert as jasmine.Spy).calls.reset();
|
||||
}
|
||||
if (jasmine.isSpy(window.confirm)) {
|
||||
(window.confirm as jasmine.Spy).calls.reset();
|
||||
}
|
||||
_resetDevErrorState();
|
||||
});
|
||||
|
||||
// Mock browser dialogs globally for tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue