Skip to content

Commit e61b120

Browse files
committed
fix test
1 parent 525f044 commit e61b120

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/compass-global-writes/src/store/index.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type {
1313
ManagedNamespace,
1414
ShardZoneMapping,
1515
} from '../services/atlas-global-writes-service';
16+
import { waitFor } from '@mongodb-js/testing-library-compass';
1617

1718
const DB = 'test';
1819
const COLL = 'coll';
@@ -153,8 +154,10 @@ describe('GlobalWritesStore Store', function () {
153154
},
154155
});
155156
await store.dispatch(fetchClusterShardingData());
156-
// expect(store.getState().status).to.equal('SHARD_KEY_CORRECT'); // no idea why this does not work
157-
expect(store.getState().managedNamespace).to.equal(managedNamespace);
157+
await waitFor(() => {
158+
expect(store.getState().status).to.equal('SHARD_KEY_CORRECT');
159+
expect(store.getState().managedNamespace).to.equal(managedNamespace);
160+
});
158161
});
159162

160163
it('sends correct data to the server when creating a shard key', async function () {

0 commit comments

Comments
 (0)