File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ describe('resolveContentRef', () => {
2121 ) ;
2222
2323 expect ( result ) . not . toBeNull ( ) ;
24- expect ( result ?. text ) . toBe ( 'Current Page' ) ;
24+ expect ( result ?. text ) . toBe ( 'Page 1 ' ) ;
2525 expect ( result ?. href ) . toBe ( '/page/page-1' ) ;
2626 } ) ;
2727
@@ -44,6 +44,25 @@ describe('resolveContentRef', () => {
4444 } ) ;
4545} ) ;
4646
47+ describe ( 'resolveContentRef with reusable content' , ( ) => {
48+ it ( 'should resolve a relative page ref with reusable content' , async ( ) => {
49+ const rcSpace = createMockSpace ( { id : 'rc-parent-space' } ) ;
50+ const context = createMockContext ( { space : rcSpace , pages : [ ] } ) ;
51+
52+ const result = await resolveContentRef (
53+ {
54+ kind : 'page' ,
55+ page : 'page-1' ,
56+ } ,
57+ context
58+ ) ;
59+
60+ expect ( result ) . not . toBeNull ( ) ;
61+ expect ( result ?. text ) . toBe ( 'Current Page' ) ;
62+ expect ( result ?. href ) . toBe ( '/page/page-1' ) ;
63+ } ) ;
64+ } ) ;
65+
4766const createMockSpace = ( space : MandateProps < Partial < api . Space > , 'id' > ) : api . Space => ( {
4867 object : 'space' ,
4968 title : 'My Space' ,
You can’t perform that action at this time.
0 commit comments