mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-10 20:46:28 +01:00
fix(ui): leave announcement placement to #19511, keep the onboarding gate
The sidebar-docked placement in #19511 already keeps the card off the account menu. Drop the measured offset here so the two changes do not conflict; this PR keeps only the first-session gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
05ba1f8a28
commit
73edd8cd68
3 files changed
+7
-92
No files matched your search
@@ -3,10 +3,10 @@ import { test, expect, request as pwRequest, type APIRequestContext, type Page }
|
||||
/**
|
||||
* E2E (N-13): the in-app announcement well ("Introducing Connectors" upsell)
|
||||
*
|
||||
* 1. stays hidden while a new company's onboarding first task is open, so it
|
||||
* cannot cover the onboarding questions in the user's first session; and
|
||||
* 2. where it does render, never covers the sidebar account menu trigger or
|
||||
* its flyout at a normal desktop size.
|
||||
* stays hidden while a new company's onboarding first task is open, so it
|
||||
* cannot cover the onboarding questions or the account menu in the user's
|
||||
* first session. Placement (never covering the account menu once shown) is
|
||||
* covered by announcement-placement.spec.ts.
|
||||
*
|
||||
* The public feed is mocked so the spec does not depend on what the live feed
|
||||
* is publishing; the card mirrors the real 2026-09-14-connectors entry.
|
||||
@@ -21,11 +21,6 @@ const ONE_PIXEL_PNG = Buffer.from(
|
||||
"base64",
|
||||
);
|
||||
|
||||
type Box = { x: number; y: number; width: number; height: number };
|
||||
function intersects(a: Box, b: Box) {
|
||||
return a.x < b.x + b.width && b.x < a.x + a.width && a.y < b.y + b.height && b.y < a.y + a.height;
|
||||
}
|
||||
|
||||
async function createCompany(board: APIRequestContext, name: string) {
|
||||
const res = await board.post(`${BASE_URL}/api/companies`, { data: { name: `${name}-${Date.now()}` } });
|
||||
if (!res.ok()) throw new Error(`POST /api/companies → ${res.status()}: ${await res.text()}`);
|
||||
@@ -98,34 +93,4 @@ test.describe("Announcement well (N-13)", () => {
|
||||
await page.screenshot({ path: test.info().outputPath("onboarding-task.png") });
|
||||
await expect(page.getByRole("complementary", { name: "Paperclip announcements" })).toHaveCount(0);
|
||||
});
|
||||
|
||||
test("where the upsell shows, it does not cover the account menu or its flyout", async ({ page }) => {
|
||||
const company = await createCompany(board, "E2E-N13-Established");
|
||||
companyIds.push(company.id);
|
||||
await createIssue(board, company.id, { title: "Ordinary task", status: "todo" });
|
||||
|
||||
await page.goto(`/${company.prefix}/dashboard`);
|
||||
const well = page.getByRole("complementary", { name: "Paperclip announcements" });
|
||||
await expect(well).toBeVisible({ timeout: 15_000 });
|
||||
await expect(well.getByRole("link", { name: "Explore connectors" })).toBeVisible();
|
||||
await page.waitForTimeout(300); // Let the entry animation finish before measuring.
|
||||
await page.screenshot({ path: test.info().outputPath("established-company.png") });
|
||||
|
||||
const trigger = page.getByRole("button", { name: "Open account menu" });
|
||||
const wellBox = await well.boundingBox();
|
||||
const triggerBox = await trigger.boundingBox();
|
||||
expect(wellBox).not.toBeNull();
|
||||
expect(triggerBox).not.toBeNull();
|
||||
expect(intersects(wellBox!, triggerBox!), `well ${JSON.stringify(wellBox)} covers account trigger ${JSON.stringify(triggerBox)}`).toBe(false);
|
||||
|
||||
// A real click lands on the trigger (Playwright fails if another element would receive it).
|
||||
await trigger.click({ timeout: 5_000 });
|
||||
const flyout = page.getByRole("dialog", { name: "Account" });
|
||||
await expect(flyout).toBeVisible();
|
||||
const flyoutBox = await flyout.boundingBox();
|
||||
if (await well.isVisible()) {
|
||||
const openWellBox = await well.boundingBox();
|
||||
expect(intersects(openWellBox!, flyoutBox!), "well covers the open account flyout").toBe(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user