This repository was archived by the owner on Nov 28, 2022. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 2 files changed +16
-11
lines changed 
packages/markdown/__tests__ Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,10 @@ exports[`anchors 1`] = `
1111`; 
1212
1313exports[`anchors  with  baseUrl  1`]  =  ` 
14- " <p><a href=\\" /child/v1.0/docs/slug\\"  target =\\"_self\\"  class =\\"doc-link\\"  data-sidebar =\\"slug\\">doc</a><br/ > 
15- <a  href =\\"/child/v1.0/reference-link/slug\\"  target =\\"_self\\">ref</a><br/ > 
16- <a  href =\\"/child/v1.0/blog/slug\\"  target =\\"_self\\">blog</a><br/ > 
17- <a  href =\\"/child/v1.0/page/slug\\"  target =\\"_self\\">page</a><br/ > 
14+ " <p><a href=\\" /child/v1.0/docs/slug\\"  target =\\"_self\\"  class =\\"doc-link\\"  data-sidebar =\\"slug\\">doc</a><br> 
15+ <a  href =\\"/child/v1.0/reference-link/slug\\"  target =\\"_self\\">ref</a><br> 
16+ <a  href =\\"/child/v1.0/blog/slug\\"  target =\\"_self\\">blog</a><br> 
17+ <a  href =\\"/child/v1.0/page/slug\\"  target =\\"_self\\">page</a><br> 
1818</p>" 
1919`; 
2020
Original file line number Diff line number Diff line change 1- const  {  shallow }  =  require ( 'enzyme' ) ; 
1+ const  {  shallow,  mount }  =  require ( 'enzyme' ) ; 
2+ const  React  =  require ( 'react' ) ; 
3+ const  BaseUrlContext  =  require ( '../contexts/BaseUrl' ) ; 
24
35const  markdown  =  require ( '../' ) ; 
46
@@ -65,20 +67,23 @@ test('anchors', () => {
6567} ) ; 
6668
6769test ( 'anchors with baseUrl' ,  ( )  =>  { 
68-   const  opts  =  {  baseUrl : '/child/v1.0'  } ; 
69-   expect ( 
70-     shallow ( 
70+   const  wrapper  =  mount ( 
71+     React . createElement ( 
72+       BaseUrlContext . Provider , 
73+       { 
74+         value : '/child/v1.0' , 
75+       } , 
7176      markdown ( 
7277        ` 
7378[doc](doc:slug) 
7479[ref](ref:slug) 
7580[blog](blog:slug) 
7681[page](page:slug) 
7782  ` , 
78-         opts , 
7983      ) , 
80-     ) . html ( ) , 
81-   ) . toMatchSnapshot ( ) ; 
84+     ) , 
85+   ) ; 
86+   expect ( wrapper . html ( ) ) . toMatchSnapshot ( ) ; 
8287} ) ; 
8388
8489test ( 'emojis' ,  ( )  =>  { 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments