From 3c467e54d57607b4af1f474b28d9d6814cd6e188 Mon Sep 17 00:00:00 2001 From: brantsrasmus Date: Fri, 3 Jul 2026 11:56:13 +0200 Subject: [PATCH] address review feedback - SessionModal: merge caller-provided className with styles.modal instead of letting it be clobbered by the {...props} spread (matches ReplayModal). - e2e test: narrow boundingBox()/viewport nullability without non-null assertions (keeps biome's noNonNullAssertion happy) via a getSheetBox helper and a shared VIEWPORT constant. --- .../[websiteId]/sessions/SessionModal.tsx | 4 ++-- tests/e2e/session-modal-dismiss.spec.ts | 21 +++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/app/(main)/websites/[websiteId]/sessions/SessionModal.tsx b/src/app/(main)/websites/[websiteId]/sessions/SessionModal.tsx index fd63247f0..1723763ad 100644 --- a/src/app/(main)/websites/[websiteId]/sessions/SessionModal.tsx +++ b/src/app/(main)/websites/[websiteId]/sessions/SessionModal.tsx @@ -8,7 +8,7 @@ export interface SessionModalProps extends ModalProps { websiteId: string; } -export function SessionModal({ websiteId, ...props }: SessionModalProps) { +export function SessionModal({ websiteId, className, ...props }: SessionModalProps) { const { router, pathname, @@ -26,7 +26,7 @@ export function SessionModal({ websiteId, ...props }: SessionModalProps) { { let auth: Auth; const websiteId = uuid(); @@ -38,7 +47,7 @@ test.describe('SessionModal outside-click dismissal', () => { }); test('clicking in the left side margin dismisses the modal', async ({ page }) => { - const box = await page.getByRole('dialog').boundingBox(); + const box = await getSheetBox(page); const marginX = 20; const midY = box.y + box.height / 2; expect(marginX).toBeLessThan(box.x); // genuinely outside the sheet @@ -50,8 +59,8 @@ test.describe('SessionModal outside-click dismissal', () => { }); test('clicking in the right side margin dismisses the modal', async ({ page }) => { - const box = await page.getByRole('dialog').boundingBox(); - const marginX = page.viewportSize().width - 20; + const box = await getSheetBox(page); + const marginX = VIEWPORT.width - 20; const midY = box.y + box.height / 2; expect(marginX).toBeGreaterThan(box.x + box.width); // genuinely outside the sheet @@ -62,7 +71,7 @@ test.describe('SessionModal outside-click dismissal', () => { }); test('control: clicking inside the sheet keeps the modal open', async ({ page }) => { - const box = await page.getByRole('dialog').boundingBox(); + const box = await getSheetBox(page); await page.mouse.click(box.x + box.width / 2, box.y + box.height / 2);