@@ -56,81 +56,6 @@ test.describe('ensure single params have been parsed correctly whilst being stab
5656 }
5757} )
5858
59- test ( 'ensure only applicable params are returned and updated with multiple params' , async ( {
60- page,
61- } ) => {
62- await page . goto ( '/params-ps/named/foo' )
63- await page . waitForLoadState ( 'networkidle' )
64-
65- const pagePathname = new URL ( page . url ( ) ) . pathname
66- expect ( pagePathname ) . toBe ( '/params-ps/named/foo' )
67-
68- const fooRenderCount = page . getByTestId ( 'foo-render-count' )
69- const fooIndexLink = page . getByTestId ( 'params-foo-links-index' )
70- const fooBar1Link = page . getByTestId ( 'params-foo-links-bar1' )
71- const fooBar2Link = page . getByTestId ( 'params-foo-links-bar2' )
72- const fooBarBazLink = page . getByTestId ( 'params-foo-bar-links-baz' )
73- const fooValue = page . getByTestId ( 'params-output' )
74- const fooBarValue = page . getByTestId ( 'foo-bar-value' )
75- const fooBazInBarValue = page . getByTestId ( 'foo-baz-in-bar-value' )
76- const fooBarRenderCount = page . getByTestId ( 'foo-bar-render-count' )
77- const fooBazInBarRenderCount = page . getByTestId ( 'foo-baz-in-bar-render-count' )
78- const fooBarBazValue = page . getByTestId ( 'foo-bar-baz-value' )
79-
80- await expect ( fooRenderCount ) . toBeInViewport ( )
81- await expect ( fooValue ) . toBeInViewport ( )
82- await expect ( fooIndexLink ) . toBeInViewport ( )
83- await expect ( fooBar1Link ) . toBeInViewport ( )
84- await expect ( fooBar2Link ) . toBeInViewport ( )
85- await expect ( fooRenderCount ) . toHaveText ( '1' )
86- await expect ( fooValue ) . toHaveText ( JSON . stringify ( { foo : 'foo' } ) )
87-
88- await fooBar1Link . click ( )
89- await page . waitForLoadState ( 'networkidle' )
90- await expect ( fooValue ) . toBeInViewport ( )
91- await expect ( fooRenderCount ) . toBeInViewport ( )
92- await expect ( fooBarRenderCount ) . toBeInViewport ( )
93- await expect ( fooBarValue ) . toBeInViewport ( )
94- await expect ( fooBazInBarValue ) . toBeInViewport ( )
95- await expect ( fooBarBazLink ) . toBeInViewport ( )
96- await expect ( fooValue ) . toHaveText ( JSON . stringify ( { foo : 'foo' } ) )
97- await expect ( fooRenderCount ) . toHaveText ( '1' )
98- await expect ( fooBarRenderCount ) . toHaveText ( '1' )
99- await expect ( fooBarValue ) . toHaveText ( '1' )
100- await expect ( fooBazInBarValue ) . toHaveText ( 'no param' )
101- await expect ( fooBazInBarRenderCount ) . toHaveText ( '1' )
102-
103- await fooBarBazLink . click ( )
104- await page . waitForLoadState ( 'networkidle' )
105- await expect ( fooValue ) . toBeInViewport ( )
106- await expect ( fooRenderCount ) . toBeInViewport ( )
107- await expect ( fooBarRenderCount ) . toBeInViewport ( )
108- await expect ( fooBarValue ) . toBeInViewport ( )
109- await expect ( fooBazInBarValue ) . toBeInViewport ( )
110- await expect ( fooValue ) . toHaveText ( JSON . stringify ( { foo : 'foo' } ) )
111- await expect ( fooRenderCount ) . toHaveText ( '1' )
112- await expect ( fooBarRenderCount ) . toHaveText ( '1' )
113- await expect ( fooBarValue ) . toHaveText ( '1' )
114- await expect ( fooBazInBarValue ) . toHaveText ( '1_10' )
115- await expect ( fooBarBazValue ) . toHaveText ( '1_10' )
116- await expect ( fooBazInBarRenderCount ) . toHaveText ( '2' )
117-
118- await fooBar2Link . click ( )
119- await expect ( fooValue ) . toBeInViewport ( )
120- await expect ( fooRenderCount ) . toBeInViewport ( )
121- await expect ( fooBarValue ) . toBeInViewport ( )
122- await expect ( fooValue ) . toHaveText ( JSON . stringify ( { foo : 'foo' } ) )
123- await expect ( fooRenderCount ) . toHaveText ( '1' )
124- await expect ( fooBarValue ) . toHaveText ( '2' )
125-
126- await fooIndexLink . click ( )
127- await expect ( fooValue ) . toBeInViewport ( )
128- await expect ( fooRenderCount ) . toBeInViewport ( )
129- await expect ( fooBarValue ) . not . toBeInViewport ( )
130- await expect ( fooValue ) . toHaveText ( JSON . stringify ( { foo : 'foo' } ) )
131- await expect ( fooRenderCount ) . toHaveText ( '1' )
132- } )
133-
13459test . describe ( 'params operations + non-nested routes' , ( ) => {
13560 test . beforeEach ( async ( { page } ) => {
13661 await page . goto ( '/params-ps/non-nested' )
@@ -147,9 +72,9 @@ test.describe('params operations + non-nested routes', () => {
14772 'href' ,
14873 '/params-ps/non-nested/foo/bar' ,
14974 )
75+
15076 await fooBarLink . click ( )
15177 await page . waitForURL ( '/params-ps/non-nested/foo/bar' )
152-
15378 const pagePathname = new URL ( page . url ( ) ) . pathname
15479 expect ( pagePathname ) . toBe ( '/params-ps/non-nested/foo/bar' )
15580
@@ -320,7 +245,7 @@ test.describe('params operations + prefix/suffix', () => {
320245 await expect ( fooBazInBarValue ) . toBeInViewport ( )
321246 await expect ( fooValue ) . toHaveText ( JSON . stringify ( { foo : 'foo' } ) )
322247 await expect ( fooRenderCount ) . toHaveText ( '1' )
323- await expect ( fooBarRenderCount ) . toHaveText ( '1 ' )
248+ await expect ( fooBarRenderCount ) . toHaveText ( '2 ' )
324249 await expect ( fooBarValue ) . toHaveText ( '1' )
325250 await expect ( fooBazInBarValue ) . toHaveText ( '1_10' )
326251 await expect ( fooBarBazValue ) . toHaveText ( '1_10' )
0 commit comments