File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
packages/compass-global-writes/src/store Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff 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
1718const DB = 'test' ;
1819const 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 ( ) {
You can’t perform that action at this time.
0 commit comments