import { test as base } from '@playwright/test';

// All e2e specs run hermetically against the mock transport. Neutralise the real
// telegram-web-app.js (loaded from the CDN in index.html) so the suite never blocks
// on telegram.org — it is unreachable from the CI runner, and a render-blocking
// <script> to it would hang every page load. Specs that exercise the Telegram launch
// inject their own window.Telegram via addInitScript before navigating.
export const test = base.extend({
  page: async ({ page }, use) => {
    await page.route('**/telegram-web-app.js', (route) =>
      route.fulfill({ status: 200, contentType: 'application/javascript', body: '' }),
    );
    await use(page);
  },
});

export { expect } from '@playwright/test';
export type { Page } from '@playwright/test';
