Skip to content

Commit 8cea184

Browse files
adrians5jclaude
andauthored
test(e2e): install the new tenant from the list, not the form (#5967)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 3fac87f commit 8cea184

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

‎e2e/tests/tenancy/tenantFileDelivery.e2e.ts‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ describe(
2222
params: { name: unique(tenantName) }
2323
});
2424

25+
// Saving a new entry leaves the form open, and the Install action lives on the list.
26+
// Go back in-app: the open form keeps a beforeunload prompt, so a page load from it is
27+
// aborted.
28+
await screen.getByRole("button", "Back").tap();
2529
const row = screen.getByRole("row").filter({ hasText: tenantName });
2630
await row.getByRole("button", "Install").tap();
2731

@@ -30,8 +34,11 @@ describe(
3034
await expect(manage).toBeVisible({ timeout: 120_000 });
3135
await manage.tap();
3236

33-
// The header's tenant selector shows the current tenant's name.
34-
await expect(screen.getByText(tenantName).first()).toBeVisible({ timeout: 30_000 });
37+
// The header's tenant selector shows the current tenant's name, with a "Root tenant"
38+
// subtitle nested in the same element, so the match can't be exact.
39+
await expect(screen.getByText(tenantName, { exact: false }).first()).toBeVisible({
40+
timeout: 30_000
41+
});
3542
});
3643

3744
test("the uploaded image downloads byte for byte", async ({
@@ -45,7 +52,7 @@ describe(
4552

4653
await app.open("/file-manager");
4754
// Still in the tenant: the switch is kept in localStorage.
48-
await expect(screen.getByText(tenantName).first()).toBeVisible();
55+
await expect(screen.getByText(tenantName, { exact: false }).first()).toBeVisible();
4956

5057
await browser
5158
.locator('input[type="file"]')

‎packages/app-headless-cms/src/presentation/contentEntries/views/ContentEntryFormView.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,12 @@ const EntryFormHeaderLeft = ({
127127
}: EntryFormHeaderLeftProps) => {
128128
return (
129129
<div className={"flex items-center gap-sm"}>
130-
<IconButton variant={"ghost"} onClick={onBack} icon={<BackIcon />} />
130+
<IconButton
131+
variant={"ghost"}
132+
aria-label={"Back"}
133+
onClick={onBack}
134+
icon={<BackIcon />}
135+
/>
131136
<Heading level={5} className={`text-neutral-primary${isNewEntry ? " opacity-50" : ""}`}>
132137
{title}
133138
</Heading>

0 commit comments

Comments
 (0)