@@ -59,8 +59,8 @@ import {
5959 Space ,
6060} from "../../src/publish/confluence/api/types.ts" ;
6161
62- const RUN_ALL_TESTS = false ;
63- const FOCUS_TEST = true ;
62+ const RUN_ALL_TESTS = true ;
63+ const FOCUS_TEST = false ;
6464
6565const xtest = (
6666 name : string ,
@@ -3639,6 +3639,23 @@ const runConvertForSecondPass = () => {
36393639 fileName : "release-planning.xml" ,
36403640 } ;
36413641
3642+ const CREATE_LINKS_ONE : ContentCreate = {
3643+ contentChangeType : ContentChangeType . create ,
3644+ title : "Release Planning" ,
3645+ type : "page" ,
3646+ status : "current" ,
3647+ ancestors : [ { id : "19759105" } ] ,
3648+ space : fakeSpace ,
3649+ body : {
3650+ storage : {
3651+ value :
3652+ "<a href='no-replace.qmd'/>no</a> content content <a href='team.qmd'>team</a> content content <a href='zqmdzz.qmd'>team</a>" ,
3653+ representation : "storage" ,
3654+ } ,
3655+ } ,
3656+ fileName : "release-planning.xml" ,
3657+ } ;
3658+
36423659 const UPDATE_LINKS_ONE_NESTED_DOT_SLASH : ContentUpdate = {
36433660 contentChangeType : ContentChangeType . update ,
36443661 id : "43778049" ,
@@ -3755,11 +3772,43 @@ const runConvertForSecondPass = () => {
37553772 check ( expected , changes , fileMetadataTable ) ;
37563773 } ) ;
37573774
3758- otest ( suiteLabel ( "one_create_noLink_convert_to_update" ) , async ( ) => {
3775+ test ( suiteLabel ( "one_create_noLink_convert_to_update" ) , async ( ) => {
37593776 const changes : ConfluenceSpaceChange [ ] = [ CREATE_NO_LINKS ] ;
37603777 const expected : ConfluenceSpaceChange [ ] = [ UPDATE_NO_LINKS ] ;
37613778 check ( expected , changes , fileMetadataTable ) ;
37623779 } ) ;
3780+
3781+ test ( suiteLabel ( "one_update_link" ) , async ( ) => {
3782+ const changes : ConfluenceSpaceChange [ ] = [ UPDATE_LINKS_ONE ] ;
3783+ const rootURL = "fake-server/wiki/spaces/QUARTOCONF/pages" ;
3784+ const expectedUpdate : ContentUpdate = {
3785+ ...UPDATE_LINKS_ONE ,
3786+ body : {
3787+ storage : {
3788+ value : `<a href=\'no-replace.qmd\'/>no</a> content content <a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/19857455/Team\'>team</a> content content <a href=\'zqmdzz.qmd\'>team</a>` ,
3789+ representation : "storage" ,
3790+ } ,
3791+ } ,
3792+ } ;
3793+ const expected : ConfluenceSpaceChange [ ] = [ expectedUpdate ] ;
3794+ check ( expected , changes , fileMetadataTable , "fake-server" , FAKE_PARENT ) ;
3795+ } ) ;
3796+
3797+ otest ( suiteLabel ( "one_update_link_from_create" ) , async ( ) => {
3798+ const changes : ConfluenceSpaceChange [ ] = [ CREATE_LINKS_ONE ] ;
3799+ const rootURL = "fake-server/wiki/spaces/QUARTOCONF/pages" ;
3800+ const expectedUpdate : ContentUpdate = {
3801+ ...UPDATE_LINKS_ONE ,
3802+ body : {
3803+ storage : {
3804+ value : `<a href=\'no-replace.qmd\'/>no</a> content content <a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/19857455/Team\'>team</a> content content <a href=\'zqmdzz.qmd\'>team</a>` ,
3805+ representation : "storage" ,
3806+ } ,
3807+ } ,
3808+ } ;
3809+ const expected : ConfluenceSpaceChange [ ] = [ expectedUpdate ] ;
3810+ check ( expected , changes , fileMetadataTable , "fake-server" , FAKE_PARENT ) ;
3811+ } ) ;
37633812} ;
37643813
37653814const runFindAttachments = ( ) => {
0 commit comments