Skip to content

Commit 099eebb

Browse files
committed
Fix tests by delaying promise resolution by a tick
1 parent 1f6dcbf commit 099eebb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/compass-app-stores/src/provider.spec.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ describe('NamespaceProvider', function () {
7676
const instance = instanceManager.getMongoDBInstanceForConnection();
7777
sandbox.stub(instance, 'fetchDatabases').callsFake(() => {
7878
instance.databases.add({ _id: 'foo' });
79-
return Promise.resolve();
79+
// Wait a tick before resolving the promise to simulate async behavior
80+
return new Promise((resolve) => {
81+
setTimeout(resolve);
82+
});
8083
});
8184

8285
await renderWithActiveConnection(

0 commit comments

Comments
 (0)