import { test, expect } from '@playwright/test';
import { ZeroDrop } from 'zerodrop-client';
const mail = new ZeroDrop();
test('email verification flow', async ({ page }) => {
// Generate a unique inbox for this test
const inbox = mail.generateInbox();
// Use the inbox in your signup form
await page.goto('/signup');
await page.fill('[data-testid="email"]', inbox);
await page.click('[data-testid="submit"]');
// Wait for the verification email
const email = await mail.waitForLatest(inbox, { timeout: 30000 });
// OTP and magic link are auto-extracted
console.log(email.otp); // "123456"
console.log(email.magicLink); // "https://yourapp.com/verify?token=..."
// Click the verification link
await page.goto(email.magicLink!);
await expect(page).toHaveURL('/dashboard');
});