@@ -3741,7 +3741,7 @@ const runUpdateLinks = () => {
37413741 fileName : "release-planning.xml" ,
37423742 } ;
37433743
3744- const UPDATE_LINKS_INDEX : ContentUpdate = {
3744+ const UPDATE_LINK_TO_INDEX : ContentUpdate = {
37453745 contentChangeType : ContentChangeType . update ,
37463746 id : "19890228" ,
37473747 version : null ,
@@ -3758,6 +3758,23 @@ const runUpdateLinks = () => {
37583758 fileName : "release-planning.xml" ,
37593759 } ;
37603760
3761+ const UPDATE_SELF_LINK_FROM_INDEX : ContentUpdate = {
3762+ contentChangeType : ContentChangeType . update ,
3763+ id : "fake-folder-id" ,
3764+ version : null ,
3765+ title : "fake-folder-title" ,
3766+ type : "page" ,
3767+ status : "current" ,
3768+ ancestors : [ { id : "19759105" } ] ,
3769+ body : {
3770+ storage : {
3771+ value : "<a href='index.qmd'>self</a>" ,
3772+ representation : "storage" ,
3773+ } ,
3774+ } ,
3775+ fileName : "folder" ,
3776+ } ;
3777+
37613778 const UPDATE_LINKS_SPECIAL_CHAR : ContentUpdate = {
37623779 contentChangeType : ContentChangeType . update ,
37633780 id : "19890228" ,
@@ -3918,10 +3935,10 @@ const runUpdateLinks = () => {
39183935 } ) ;
39193936
39203937 test ( suiteLabel ( "one_update_link_index" ) , async ( ) => {
3921- const changes : ConfluenceSpaceChange [ ] = [ UPDATE_LINKS_INDEX ] ;
3938+ const changes : ConfluenceSpaceChange [ ] = [ UPDATE_LINK_TO_INDEX ] ;
39223939 const rootURL = "fake-server/wiki/spaces/QUARTOCONF/pages" ;
39233940 const expectedUpdate : ContentUpdate = {
3924- ...UPDATE_LINKS_INDEX ,
3941+ ...UPDATE_LINK_TO_INDEX ,
39253942 body : {
39263943 storage : {
39273944 value : `<a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/fake-folder-id'>team</a>` ,
@@ -3933,6 +3950,22 @@ const runUpdateLinks = () => {
39333950 check ( expected , changes , fileMetadataTable , "fake-server" , FAKE_PARENT ) ;
39343951 } ) ;
39353952
3953+ test ( suiteLabel ( "one_update_link_from_index" ) , async ( ) => {
3954+ const changes : ConfluenceSpaceChange [ ] = [ UPDATE_SELF_LINK_FROM_INDEX ] ;
3955+ const rootURL = "fake-server/wiki/spaces/QUARTOCONF/pages" ;
3956+ const expectedUpdate : ContentUpdate = {
3957+ ...UPDATE_SELF_LINK_FROM_INDEX ,
3958+ body : {
3959+ storage : {
3960+ value : `<a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/fake-index-id'>self</a>` ,
3961+ representation : "storage" ,
3962+ } ,
3963+ } ,
3964+ } ;
3965+ const expected : ConfluenceSpaceChange [ ] = [ expectedUpdate ] ;
3966+ check ( expected , changes , fileMetadataTable , "fake-server" , FAKE_PARENT ) ;
3967+ } ) ;
3968+
39363969 test ( suiteLabel ( "one_update_link_special_char" ) , async ( ) => {
39373970 const changes : ConfluenceSpaceChange [ ] = [ UPDATE_LINKS_SPECIAL_CHAR ] ;
39383971 const rootURL = "fake-server/wiki/spaces/QUARTOCONF/pages" ;
0 commit comments