Skip to content

Commit 1492e1f

Browse files
author
Al Manning
committed
more move between folder tests
1 parent 99f7cf1 commit 1492e1f

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/publish/confluence/confluence-helper.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,6 @@ export const buildSpaceChanges = (
351351
return false;
352352
});
353353

354-
// TODO on create, replace nested parent ID
355-
// ancestors: [ { id: "authoring" } ]
356354
console.log("existingSite", existingSite);
357355
console.log("existingSiteParent", existingSiteParent);
358356

src/publish/confluence/confluence.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ import {
7878
verifyConfluenceParent,
7979
verifyLocation,
8080
} from "./confluence-verify.ts";
81-
import { DELETE_DISABLED } from "./constants.ts";
81+
import { DELETE_DISABLED, DELETE_SLEEP_MILLIS } from "./constants.ts";
8282
import { logError, trace } from "./confluence-logger.ts";
8383
import { md5Hash } from "../../core/hash.ts";
8484
import { sleep } from "../../core/async.ts";
@@ -629,11 +629,12 @@ async function publish(
629629
siteParent
630630
);
631631

632-
let pathsToId: Record<string, string> = {};
632+
let pathsToId: Record<string, string> = {}; // build from existing site
633633

634634
const doChange = async (change: ConfluenceSpaceChange) => {
635635
if (isContentCreate(change)) {
636-
console.log("DO CREATE");
636+
console.log("DO CREATE", change);
637+
637638
let ancestorId =
638639
(change?.ancestors && change?.ancestors[0]?.id) ?? null;
639640
console.log("ancestorId", ancestorId);
@@ -657,6 +658,7 @@ async function publish(
657658

658659
if (change.fileName) {
659660
pathsToId[change.fileName] = result.id ?? "";
661+
console.log("pathsToId added", pathsToId);
660662
}
661663

662664
const contentPropertyResult: Content =
@@ -682,7 +684,7 @@ async function publish(
682684
return null;
683685
}
684686
const result = await client.deleteContent(change);
685-
await sleep(2000); // Consider polling on delete to support uniqify rather than sleep
687+
await sleep(DELETE_SLEEP_MILLIS); // TODO replace with polling
686688
return result;
687689
} else {
688690
console.error("Space Change not defined");

src/publish/confluence/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ export const V2EDITOR_METADATA = {
1111
},
1212
},
1313
};
14+
15+
export const DELETE_SLEEP_MILLIS = 5000; //TODO replace with polling

tests/unit/confluence.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,7 +2173,7 @@ const runSpaceUpdatesWithNestedMoves = () => {
21732173
},
21742174
};
21752175

2176-
unitTest(suiteLabel("move_from_root_to_parent"), async () => {
2176+
unitTest(suiteLabel("move_from_root_to_nested_parent"), async () => {
21772177
const fileMetadataList: SiteFileMetadata[] = [fakeNestedFile];
21782178
const existingSite = [
21792179
{
@@ -2951,6 +2951,6 @@ if (runAllTests) {
29512951
runUpdateImagePathsForContentBody();
29522952
} else {
29532953
// runSpaceCreatesWithNesting();
2954-
runSpaceUpdatesWithNestedMoves();
29552954
// runSpaceUpdatesWithNesting();
2955+
runSpaceUpdatesWithNestedMoves();
29562956
}

0 commit comments

Comments
 (0)