File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -946,6 +946,34 @@ describe('Router', () => {
946946 expect ( scratch ) . to . have . property ( 'textContent' , 'data' ) ;
947947 } ) ;
948948
949+ it ( 'should support navigating backwards and forwards' , async ( ) => {
950+ render (
951+ < LocationProvider >
952+ < Router >
953+ < Route path = "/" component = { ( ) => null } />
954+ < Route path = "/foo" component = { ( ) => null } />
955+ </ Router >
956+ < ShallowLocation />
957+ </ LocationProvider > ,
958+ scratch
959+ ) ;
960+
961+ navigation . navigate ( '/foo' ) ;
962+ await sleep ( 10 ) ;
963+
964+ expect ( loc ) . to . deep . include ( { url : '/foo' , path : '/foo' , searchParams : { } } ) ;
965+
966+ navigation . back ( ) ;
967+ await sleep ( 10 ) ;
968+
969+ expect ( loc ) . to . deep . include ( { url : '/' , path : '/' , searchParams : { } } ) ;
970+
971+ navigation . forward ( ) ;
972+ await sleep ( 10 ) ;
973+
974+ expect ( loc ) . to . deep . include ( { url : '/foo' , path : '/foo' , searchParams : { } } ) ;
975+ } ) ;
976+
949977 it ( 'should intercept clicks on links inside open shadow DOM' , async ( ) => {
950978 const shadowlink = document . createElement ( 'a' ) ;
951979 shadowlink . href = '/shadow' ;
You can’t perform that action at this time.
0 commit comments