@@ -226,37 +226,47 @@ describe('views dir', () => {
226226 expect ( html ) . toContain ( 'hello from root/shared-component-route' )
227227 } )
228228
229- // TODO: implement
230- it . skip ( 'should serve client component' , async ( ) => {
231- const html = await renderViaHTTP ( next . url , '/client-component-route' )
232- expect ( html ) . toContain ( 'hello from root/client-component-route. count: 0' )
233-
234- const browser = await webdriver ( next . url , '/client-component-route' )
235- // After hydration count should be 1
236- expect ( await browser . elementByCss ( 'p' ) . text ( ) ) . toBe (
237- 'hello from root/client-component-route. count: 1'
238- )
229+ describe ( 'should serve client component' , ( ) => {
230+ it ( 'should serve server-side' , async ( ) => {
231+ const html = await renderViaHTTP ( next . url , '/client-component-route' )
232+ const $ = cheerio . load ( html )
233+ expect ( $ ( 'p' ) . text ( ) ) . toBe (
234+ 'hello from root/client-component-route. count: 0'
235+ )
236+ } )
237+
238+ // TODO: Implement hydration
239+ it . skip ( 'should serve client-side' , async ( ) => {
240+ const browser = await webdriver ( next . url , '/client-component-route' )
241+ // After hydration count should be 1
242+ expect ( await browser . elementByCss ( 'p' ) . text ( ) ) . toBe (
243+ 'hello from root/client-component-route. count: 1'
244+ )
245+ } )
239246 } )
240247
241- // TODO: implement
242- it . skip ( 'should include client component layout with server component route' , async ( ) => {
243- const html = await renderViaHTTP ( next . url , '/client-nested' )
244- const $ = cheerio . load ( html )
245- // Should not be nested in dashboard
246- expect ( $ ( 'h1' ) . text ( ) ) . toBe ( 'Client Nested. Count: 0' )
247- // Should include the page text
248- expect ( $ ( 'p' ) . text ( ) ) . toBe ( 'hello from root/client-nested' )
249-
250- const browser = await webdriver ( next . url , '/client-nested' )
251- // After hydration count should be 1
252- expect ( await browser . elementByCss ( 'h1' ) . text ( ) ) . toBe (
253- 'Client Nested. Count: 0'
254- )
255-
256- // After hydration count should be 1
257- expect ( await browser . elementByCss ( 'h1' ) . text ( ) ) . toBe (
258- 'hello from root/client-nested'
259- )
248+ describe ( 'should include client component layout with server component route' , ( ) => {
249+ it ( 'should include it server-side' , async ( ) => {
250+ const html = await renderViaHTTP ( next . url , '/client-nested' )
251+ const $ = cheerio . load ( html )
252+ // Should not be nested in dashboard
253+ expect ( $ ( 'h1' ) . text ( ) ) . toBe ( 'Client Nested. Count: 0' )
254+ // Should include the page text
255+ expect ( $ ( 'p' ) . text ( ) ) . toBe ( 'hello from root/client-nested' )
256+ } )
257+
258+ // TODO: Implement hydration
259+ it . skip ( 'should include it client-side' , async ( ) => {
260+ const browser = await webdriver ( next . url , '/client-nested' )
261+ // After hydration count should be 1
262+ expect ( await browser . elementByCss ( 'h1' ) . text ( ) ) . toBe (
263+ 'Client Nested. Count: 0'
264+ )
265+ // After hydration count should be 1
266+ expect ( await browser . elementByCss ( 'h1' ) . text ( ) ) . toBe (
267+ 'hello from root/client-nested'
268+ )
269+ } )
260270 } )
261271 } )
262272} )
0 commit comments