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

// Test authentication flow against your running application
test.describe('Authentication Flow Tests', () => {
  test('should access login page', async ({ page }) => {
    await page.goto('http://localhost:3001/auth/login');

    // Check that we're on the login page
    await expect(page).toHaveTitle(/Login/);

    // Check for login form elements
    await expect(page.getByText('Login')).toBeVisible();
    await expect(page.getByPlaceholder('Email')).toBeVisible();
    await expect(page.getByPlaceholder('Password')).toBeVisible();
    await expect(page.getByRole('button', { name: 'Sign in' })).toBeVisible();
  });

  test('should access signup page', async ({ page }) => {
    await page.goto('http://localhost:3001/auth/signup');

    // Check that we're on the signup page
    await expect(page).toHaveTitle(/Sign Up/);

    // Check for signup form elements
    await expect(page.getByText('Sign Up')).toBeVisible();
    await expect(page.getByPlaceholder('Email')).toBeVisible();
    await expect(page.getByPlaceholder('Password')).toBeVisible();
    await expect(page.getByRole('button', { name: 'Sign up' })).toBeVisible();
  });
});