Skip to content

Commit d573635

Browse files
committed
fix test
1 parent 525f044 commit d573635

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 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';
@@ -109,7 +110,7 @@ describe('GlobalWritesStore Store', function () {
109110
expect(store.getState().status).to.equal('UNSHARDED');
110111
});
111112

112-
it('when the namespace is managed', async function () {
113+
it.only('when the namespace is managed', async function () {
113114
const store = createStore({
114115
authenticatedFetch: (uri: string) => {
115116
if (uri.includes('/clusters/')) {
@@ -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)