File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { LinkRenderer } from './LinkRenderer' ;
2
+ import { PageLinkResolver } from './PageLinkResolver' ;
2
3
import { RenderDatabasePageTask } from './RenderDatabasePageTask' ;
3
4
4
5
describe ( "LinkRenderer" , ( ) => {
6
+
5
7
test ( "renderPageLink strips outDir from link" , async ( ) => {
8
+ const resolver = new PageLinkResolver ( "out" ) ;
6
9
const sut = new LinkRenderer ( ) ;
7
10
const page : Partial < RenderDatabasePageTask > = {
8
11
file : "out/test.md" ,
9
12
} ;
10
13
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)" ) ;
13
16
} ) ;
14
17
} ) ;
Original file line number Diff line number Diff line change 1
1
import { Annotations , RichText } from '@notionhq/client/build/src/api-types' ;
2
+ import { RenderingContext } from './RenderingContext' ;
2
3
3
- import { RenderingLoggingContext } from './logger' ;
4
4
import { RichTextRenderer } from './RichTextRenderer' ;
5
5
6
6
function annotations ( x : Partial < Annotations > ) : Annotations {
@@ -15,7 +15,7 @@ function annotations(x: Partial<Annotations>): Annotations {
15
15
} ;
16
16
}
17
17
18
- const context = new RenderingLoggingContext ( "" ) ;
18
+ const context = new RenderingContext ( "" , "" ) ;
19
19
20
20
describe ( "RichTextRenderer" , ( ) => {
21
21
let sut : RichTextRenderer ;
You can’t perform that action at this time.
0 commit comments