File tree Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -473,6 +473,21 @@ function defineTest(f: Fixture) {
473473        'color' , 
474474        'rgb(255, 165, 0)' , 
475475      ) 
476+       await  expectNoServerLinkStylesheet ( page ) 
477+     } ) 
478+ 
479+     function  expectNoServerLinkStylesheet ( page : Page )  { 
480+       // check only manually inserted stylesheet link exists 
481+       return  expect ( page . locator ( 'link[rel="stylesheet"]' ) ) . toHaveAttribute ( 
482+         'href' , 
483+         '/test-style-server-manual.css' , 
484+       ) 
485+     } 
486+ 
487+     test ( 'no duplicate css' ,  async  ( {  page } )  =>  { 
488+       await  page . goto ( f . url ( ) ) 
489+       await  waitForHydration ( page ) 
490+       await  expectNoServerLinkStylesheet ( page ) 
476491    } ) 
477492
478493    test ( 'adding/removing css client @js' ,  async  ( {  page } )  =>  { 
@@ -557,6 +572,7 @@ function defineTest(f: Fixture) {
557572        'color' , 
558573        'rgb(255, 165, 0)' , 
559574      ) 
575+       await  expectNoServerLinkStylesheet ( page ) 
560576    } ) 
561577
562578    // TODO: need a way to add/remove links on server hmr. for now, it requires a manually reload. 
Original file line number Diff line number Diff line change @@ -6,12 +6,6 @@ import { waitForHydration } from './helper'
66test . describe ( 'dev-default' ,  ( )  =>  { 
77  const  f  =  useFixture ( {  root : 'examples/starter' ,  mode : 'dev'  } ) 
88  defineStarterTest ( f ) 
9- 
10-   test ( 'no duplicate css' ,  async  ( {  page } )  =>  { 
11-     await  page . goto ( f . url ( ) ) 
12-     await  waitForHydration ( page ) 
13-     // TODO 
14-   } ) 
159} ) 
1610
1711test . describe ( 'build-default' ,  ( )  =>  { 
File renamed without changes.
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export function TestStyleServer() {
1010      </ div > 
1111      < link 
1212        rel = "stylesheet" 
13-         href = "/test.css" 
13+         href = "/test-style-server-manual .css" 
1414        precedence = "test-style-server-manual" 
1515      /> 
1616      < div  className = "test-style-server-manual" > test-style-server-manual</ div > 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments