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

test('check event page with my other bets', async ({ page }) => {
  const errors: string[] = [];

  page.on('pageerror', error => {
    console.log('Page error:', error.message);
    errors.push(error.message);
  });

  // Navigate to event detail
  await page.goto('/events/1', { waitUntil: 'networkidle' });
  await page.waitForTimeout(3000);

  // Take screenshot
  await page.screenshot({ path: 'test-results/event-with-other-bets.png', fullPage: true });

  // Check for the "My Other Bets" section
  const myOtherBetsSection = await page.locator('text=My Other Bets').count();
  console.log('My Other Bets section found:', myOtherBetsSection > 0);

  // Check body text
  const bodyText = await page.locator('body').innerText();
  console.log('Has "My Other Bets":', bodyText.includes('My Other Bets'));

  console.log('Page errors:', errors);
});
