File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
packages/ra-core/src/controller/list Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -684,6 +684,36 @@ describe('useListParams', () => {
684684 } ) ;
685685 } ) ;
686686
687+ it ( 'should not synchronize location with store if the store parameters are the defaults' , async ( ) => {
688+ let location ;
689+ render (
690+ < TestMemoryRouter
691+ locationCallback = { l => {
692+ location = l ;
693+ } }
694+ >
695+ < CoreAdminContext dataProvider = { testDataProvider ( ) } >
696+ < Component disableSyncWithLocation />
697+ </ CoreAdminContext >
698+ </ TestMemoryRouter >
699+ ) ;
700+
701+ // Let React do its thing
702+ await new Promise ( resolve => setTimeout ( resolve , 0 ) ) ;
703+
704+ await waitFor ( ( ) => {
705+ expect ( location ) . toEqual (
706+ expect . objectContaining ( {
707+ hash : '' ,
708+ key : expect . any ( String ) ,
709+ state : null ,
710+ pathname : '/' ,
711+ search : '' ,
712+ } )
713+ ) ;
714+ } ) ;
715+ } ) ;
716+
687717 it ( 'should not synchronize location with store when sync is not enabled' , async ( ) => {
688718 let location ;
689719 let storeValue ;
You can’t perform that action at this time.
0 commit comments