From 2273e8f82b0e7a39a740d3f75aef327252949e7e Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 3 Oct 2026 17:08:39 +0000 Subject: [PATCH] test(onboarding): link the foreign folder while its tenant owns the deployment Since #112 only the deployment owner can link a host folder, so the discovery test creates the other tenant's linked space while that tenant holds the deployment, then hands the deployment to the scanning owner. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01MRtGG9ARfqqhma3t85Ro2u --- packages/testkit/src/onboarding-discovery.postgres.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/testkit/src/onboarding-discovery.postgres.test.ts b/packages/testkit/src/onboarding-discovery.postgres.test.ts index 671131b..e1656bc 100644 --- a/packages/testkit/src/onboarding-discovery.postgres.test.ts +++ b/packages/testkit/src/onboarding-discovery.postgres.test.ts @@ -149,13 +149,15 @@ describeWithDatabase("onboarding discovery through the API", () => { it("creates the chosen projects in the owner's own spaces and saves only the chosen facts", async () => { const owner = await account("discovery-creator"); const intruder = await account("discovery-intruder"); - await makeDeploymentOwner(owner.actor); const atlasFolder = path.join(home, "code/atlas"); - // Another tenant already linked a space with the same name to the same folder. + // Another tenant already linked a space with the same name to the same folder, back when + // they held the deployment (only the deployment owner can link host folders). + await makeDeploymentOwner(intruder.actor); const foreign = await rpc<{ id: string }>(app, intruder.cookie, "spaces/create", { name: "atlas", workspacePath: atlasFolder, }); + await makeDeploymentOwner(owner.actor); const scan = await finishedScan(owner.cookie); const choice = {