import assert from "node:assert/strict"; import { readFileSync } from "node:fs"; const page = readFileSync(new URL("../src/features/files/FilesPage.tsx", import.meta.url), "utf8"); const api = readFileSync(new URL("../src/api/files.ts", import.meta.url), "utf8"); assert.match(api, /connector-spaces\/\$\{encodeURIComponent\(spaceId\)\}\/sync/); assert.match(api, /conflict_strategy: "skip", max_files: 100, max_depth: 12/); assert.match(page, /syncFileConnectorSpaceFolder\(settings, space\.connector_space_id/); assert.match(page, /recursive: folderSyncRecursive/); assert.match(page, /conflict_strategy: folderSyncConflictStrategy/); assert.match(page, /folderSyncResult\.items\.map/); assert.match(page, /folderSyncActionLabel\(item\.action\)/); for (const contextId of [ "files.connector-folder-sync.remote-path", "files.connector-folder-sync.target-folder", "files.connector-folder-sync.conflict-strategy", "files.connector-folder-sync.max-files", "files.connector-folder-sync.recursive" ]) { assert.ok(page.includes(`helpContextId="${contextId}"`), `missing contextual help for ${contextId}`); } assert.doesNotMatch(page, /window\.confirm\([\s\S]*connector-folder-sync/); console.log("Connector folder-sync structure checks passed.");