chore: save WIP before workstation switch

This commit is contained in:
2026-05-18 17:33:31 -07:00
parent 98b18de00a
commit 2c5666e419
30 changed files with 765 additions and 395 deletions
+13 -12
View File
@@ -13,6 +13,7 @@
import { test, expect } from '@playwright/test';
import { prisma } from '@/lib/prisma';
const BASE_URL = process.env.CI ? 'https://euchre-ci.notsosm.art' : 'http://localhost:3000';
function getTestCredentials() {
const timestamp = Date.now();
@@ -34,11 +35,11 @@ test.describe.serial('Issue #7: Schedule Tab', () => {
testPassword = credentials.password;
// Create admin user via API
const response = await fetch('http://localhost:3000/api/auth/sign-up/email', {
const response = await fetch(`${BASE_URL}/api/auth/sign-up/email`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Origin: 'http://localhost:3000',
Origin: BASE_URL,
},
body: JSON.stringify({
email: testEmail,
@@ -128,14 +129,14 @@ test.describe.serial('Issue #7: Schedule Tab', () => {
test('Schedule tab link exists on tournament detail page', async ({ page }) => {
// Login
await page.goto('http://localhost:3000/auth/login');
await page.goto('/auth/login');
await page.fill('input[name="email"]', testEmail);
await page.fill('input[name="password"]', testPassword);
await page.click('button[type="submit"]');
await page.waitForURL(/\/(admin|players)/, { timeout: 10000 });
// Navigate to tournament detail
await page.goto(`http://localhost:3000/admin/tournaments/${tournamentId}`);
await page.goto(`/admin/tournaments/${tournamentId}`);
// Check Schedule tab link exists
const scheduleLink = page.locator('a', { hasText: 'Schedule' });
@@ -144,14 +145,14 @@ test.describe.serial('Issue #7: Schedule Tab', () => {
test('Schedule page loads with no schedule message', async ({ page }) => {
// Login
await page.goto('http://localhost:3000/auth/login');
await page.goto('/auth/login');
await page.fill('input[name="email"]', testEmail);
await page.fill('input[name="password"]', testPassword);
await page.click('button[type="submit"]');
await page.waitForURL(/\/(admin|players)/, { timeout: 10000 });
// Navigate to schedule page
await page.goto(`http://localhost:3000/admin/tournaments/${tournamentId}/schedule`);
await page.goto(`/admin/tournaments/${tournamentId}/schedule`);
// Check page content
await expect(page.locator('h1')).toContainText('Tournament Schedule');
@@ -161,14 +162,14 @@ test.describe.serial('Issue #7: Schedule Tab', () => {
test('Generate schedule creates rounds and matchups', async ({ page }) => {
// Login
await page.goto('http://localhost:3000/auth/login');
await page.goto('/auth/login');
await page.fill('input[name="email"]', testEmail);
await page.fill('input[name="password"]', testPassword);
await page.click('button[type="submit"]');
await page.waitForURL(/\/(admin|players)/, { timeout: 10000 });
// Navigate to schedule page
await page.goto(`http://localhost:3000/admin/tournaments/${tournamentId}/schedule`);
await page.goto(`/admin/tournaments/${tournamentId}/schedule`);
// Click generate schedule
await page.click('button:has-text("Generate Schedule")');
@@ -191,14 +192,14 @@ test.describe.serial('Issue #7: Schedule Tab', () => {
test('Schedule page displays generated rounds and matchups', async ({ page }) => {
// Login
await page.goto('http://localhost:3000/auth/login');
await page.goto('/auth/login');
await page.fill('input[name="email"]', testEmail);
await page.fill('input[name="password"]', testPassword);
await page.click('button[type="submit"]');
await page.waitForURL(/\/(admin|players)/, { timeout: 10000 });
// Navigate to schedule page
await page.goto(`http://localhost:3000/admin/tournaments/${tournamentId}/schedule`);
await page.goto(`/admin/tournaments/${tournamentId}/schedule`);
// Check that rounds are displayed
await expect(page.locator('text=Round 1')).toBeVisible();
@@ -213,7 +214,7 @@ test.describe.serial('Issue #7: Schedule Tab', () => {
test('Schedule API returns rounds with matchups', async ({ page }) => {
// Login
await page.goto('http://localhost:3000/auth/login');
await page.goto('/auth/login');
await page.fill('input[name="email"]', testEmail);
await page.fill('input[name="password"]', testPassword);
await page.click('button[type="submit"]');
@@ -221,7 +222,7 @@ test.describe.serial('Issue #7: Schedule Tab', () => {
// Call the schedule API
const response = await page.request.get(
`http://localhost:3000/api/tournaments/${tournamentId}/schedule`
`/api/tournaments/${tournamentId}/schedule`
);
expect(response.ok()).toBe(true);