@@ -9,17 +9,17 @@ const params = {
99 filters : [
1010 { category : 'ca-1' , value : 'va-1' } ,
1111 { category : 'ca-2' , value : 'va-2' } ,
12- { category : 'ca-2' , value : 'va-3' } ,
12+ { category : 'ca-2' , value : 'va-3' }
1313 ] ,
1414 number : 123 ,
1515 string : 'test-string' ,
16- ignored : { test : 'value' } ,
16+ ignored : { test : 'value' }
1717}
1818const paramsAsSearch = '&ca-1=va-1&ca-2=va-2%2Cva-3&number=123&string=test-string'
1919const state = {
2020 browseParams : params ,
2121 searchParams : params ,
22- taskParams : params ,
22+ taskParams : params
2323}
2424
2525const dispatch = jest . fn ( )
@@ -39,12 +39,6 @@ describe('actions - sync-url-search-params', () => {
3939 expect ( dispatch ) . not . toBeCalled ( )
4040 } )
4141
42- it ( 'should dispatch the `push` action with the new url' , async ( ) => {
43- await syncUrlSearchParams ( state ) ( dispatch )
44- expect ( dispatch ) . toBeCalled ( )
45- expect ( push ) . toBeCalledWith ( '/browse-projects' )
46- } )
47-
4842 it ( 'should `push` with the new search params from state' , async ( ) => {
4943 pushPath ( '/browse-projects?a=123&b=test' )
5044 await syncUrlSearchParams ( state ) ( dispatch )
@@ -75,29 +69,6 @@ describe('actions - sync-url-search-params', () => {
7569 } )
7670 } )
7771
78- describe ( 'on `/open-tasks` route' , ( ) => {
79- beforeEach ( ( ) => {
80- pushPath ( '/open-tasks' )
81- } )
82-
83- it ( 'should not dispatch any actions if `taskParams` are not in state' , async ( ) => {
84- await syncUrlSearchParams ( { ...state , taskParams : undefined } ) ( dispatch )
85- expect ( dispatch ) . not . toBeCalled ( )
86- } )
87-
88- it ( 'should dispatch the `push` action with the new url' , async ( ) => {
89- await syncUrlSearchParams ( state ) ( dispatch )
90- expect ( dispatch ) . toBeCalled ( )
91- expect ( push ) . toBeCalledWith ( '/open-tasks' )
92- } )
93-
94- it ( 'should `push` with the new task params from state' , async ( ) => {
95- pushPath ( '/open-tasks?a=123&b=test' )
96- await syncUrlSearchParams ( state ) ( dispatch )
97- expect ( push ) . toBeCalledWith ( `/open-tasks?${ paramsAsSearch } ` )
98- } )
99- } )
100-
10172 describe ( 'on other route' , ( ) => {
10273 beforeEach ( ( ) => {
10374 pushPath ( '/other-route' )
@@ -108,4 +79,4 @@ describe('actions - sync-url-search-params', () => {
10879 expect ( dispatch ) . not . toBeCalled ( )
10980 } )
11081 } )
111- } )
82+ } )
0 commit comments