From d4114bb2c6375c27a6bc60bedfd97bf9f1499150 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Thu, 27 Aug 2026 16:03:22 -0700 Subject: [PATCH] Fix notification permission thing --- e2e/harness/index.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/e2e/harness/index.ts b/e2e/harness/index.ts index ea2c6c10..aae8c76b 100644 --- a/e2e/harness/index.ts +++ b/e2e/harness/index.ts @@ -187,6 +187,20 @@ export const test = base.extend({ await injectNip07(context, options.nip07) } + // Playwright grants the "notifications" permission at the browser level, but headless Chromium + // still reports `Notification.permission` as "denied", so a spec that opted into notifications + // would watch the app's push-enable refuse a permission it was given. Reflect the grant into + // the Notification API the app actually reads. + if (options.context?.permissions?.includes("notifications")) { + await context.addInitScript(() => { + Object.defineProperty(Notification, "permission", { + configurable: true, + get: () => "granted", + }) + Notification.requestPermission = () => Promise.resolve("granted") + }) + } + return boot(context, { user, path,