fix: update test to work with native browser

This commit is contained in:
2026-02-04 21:47:22 -03:00
parent ea2779c681
commit 2c332c6758

View File

@@ -29,12 +29,7 @@ describe('OPFS', () => {
getFileHandle: vi.fn().mockResolvedValue(fileHandleMock),
removeEntry: vi.fn()
};
(<any>globalThis.navigator).storage = {
getDirectory: vi.fn().mockResolvedValue(dirHandleMock),
persist: vi.fn().mockResolvedValue(true),
persisted: vi.fn().mockResolvedValue(true),
estimate: vi.fn().mockResolvedValue({ usage: 100, quota: 1000 }),
};
vi.spyOn(globalThis.navigator.storage, 'getDirectory').mockResolvedValue(dirHandleMock as any);
TestBed.configureTestingModule({});
service = TestBed.inject(OPFS);