@@ -115,25 +115,29 @@ describe('app-dir - metadata-streaming', () => {
115
115
const browser = await next . browser ( '/parallel-routes' )
116
116
await browser . elementByCss ( '[href="/parallel-routes/no-bar"]' ) . click ( )
117
117
118
+ // Wait for navigation is finished and metadata is updated
118
119
await retry ( async ( ) => {
119
120
expect ( await browser . elementByCss ( 'title' ) . text ( ) ) . toContain (
120
121
'Dynamic api'
121
122
)
122
123
} )
123
124
124
- expect ( ( await browser . elementsByCss ( 'title' ) ) . length ) . toBe ( 1 )
125
+ await retry ( async ( ) => {
126
+ expect ( ( await browser . elementsByCss ( 'title' ) ) . length ) . toBe ( 1 )
127
+ } )
125
128
} )
126
129
127
130
it ( 'should still render layout metadata if children is not rendered but rest slots are' , async ( ) => {
128
- const browser = await next . browser ( '/parallel-routes-no-children' )
131
+ const browser = await next . browser ( '/parallel-routes-no-children/test-page ' )
129
132
130
- expect ( ( await browser . elementsByCss ( 'head title' ) ) . length ) . toBe ( 1 )
131
- expect ( ( await browser . elementsByCss ( 'body title' ) ) . length ) . toBe ( 0 )
132
- expect ( await browser . elementByCss ( 'title' ) . text ( ) ) . toBe ( 'parallel title' )
133
+ expect ( ( await browser . elementsByCss ( 'title' ) ) . length ) . toBe ( 1 )
134
+ expect ( await browser . elementByCss ( 'title' ) . text ( ) ) . toMatch (
135
+ / D y n a m i c a p i \d + /
136
+ )
133
137
134
- const $ = await next . render$ ( '/parallel-routes-no-children' )
138
+ const $ = await next . render$ ( '/parallel-routes-no-children/test-page ' )
135
139
expect ( $ ( 'title' ) . length ) . toBe ( 1 )
136
- expect ( $ ( 'head title' ) . text ( ) ) . toBe ( 'parallel title' )
140
+ expect ( $ ( 'head title' ) . text ( ) ) . toMatch ( / D y n a m i c a p i \d + / )
137
141
} )
138
142
139
143
describe ( 'dynamic api' , ( ) => {
0 commit comments