File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 11import { LinkRenderer } from './LinkRenderer' ;
2+ import { PageLinkResolver } from './PageLinkResolver' ;
23import { RenderDatabasePageTask } from './RenderDatabasePageTask' ;
34
45describe ( "LinkRenderer" , ( ) => {
6+
57 test ( "renderPageLink strips outDir from link" , async ( ) => {
8+ const resolver = new PageLinkResolver ( "out" ) ;
69 const sut = new LinkRenderer ( ) ;
710 const page : Partial < RenderDatabasePageTask > = {
811 file : "out/test.md" ,
912 } ;
1013
11- const link = sut . renderPageLink ( "text" , page as any ) ;
12- expect ( link ) . toEqual ( "[text](/out /test.md)" ) ;
14+ const link = sut . renderPageLink ( "text" , page as any , resolver ) ;
15+ expect ( link ) . toEqual ( "[text](. /test.md)" ) ;
1316 } ) ;
1417} ) ;
Original file line number Diff line number Diff line change 11import { Annotations , RichText } from '@notionhq/client/build/src/api-types' ;
2+ import { RenderingContext } from './RenderingContext' ;
23
3- import { RenderingLoggingContext } from './logger' ;
44import { RichTextRenderer } from './RichTextRenderer' ;
55
66function annotations ( x : Partial < Annotations > ) : Annotations {
@@ -15,7 +15,7 @@ function annotations(x: Partial<Annotations>): Annotations {
1515 } ;
1616}
1717
18- const context = new RenderingLoggingContext ( "" ) ;
18+ const context = new RenderingContext ( "" , "" ) ;
1919
2020describe ( "RichTextRenderer" , ( ) => {
2121 let sut : RichTextRenderer ;
You can’t perform that action at this time.
0 commit comments