import { readFileSync } from 'node:fs' import { resolve } from 'node:path' import { expect, test } from '@playwright/test' const providerSource = readFileSync( resolve(process.cwd(), 'public/nostr-provider.js'), 'utf8', ) test('mobile Chromium returns to the live app after the signer is hidden', async ({ context, page }) => { await page.setViewportSize({ width: 390, height: 844 }) await context.route('**/*', async (route) => { const url = new URL(route.request().url()) if (url.pathname === '/nostr-provider.js') { await route.fulfill({ contentType: 'application/javascript', body: providerSource }) return } if (url.port === '' && url.pathname === '/nostr-signer') { await route.fulfill({ contentType: 'text/html', body: `
`, }) return } if (url.port === '7778') { await route.fulfill({ contentType: 'text/html', body: `