9 Commits

Author SHA1 Message Date
david 493ae0cf71 test: enable player schedule tests with match data setup
Pull Request / e2e-tests (pull_request) Has been cancelled
Pull Request / analyze-bump-type (pull_request) Has been cancelled
Pull Request / unit-tests (pull_request) Has been cancelled
Related to #9

- Implemented 'I have upcoming matches in my schedule' step to create
  tournament, players, and match with future date
- Added step definitions for schedule content verification
- 2 player schedule scenarios now active (empty schedule, upcoming matches)
- 'Click on match' scenario remains @wip (page lacks match detail links)

Player schedule page at /players/[id]/schedule shows upcoming matches
with tournament name, player names, and dates.
2026-04-26 20:50:05 -07:00
Gitea Actions 72d4b85970 chore: bump version to v0.1.12 2026-04-27 03:40:52 +00:00
david 7cdc8d2eb4 ci: clear Bun cache before install to fix integrity check failures
Release / release (push) Failing after 12s
2026-04-26 20:40:42 -07:00
Gitea Actions 7a7b4dd122 chore: bump version to v0.1.11 2026-04-27 03:16:22 +00:00
david 926c6dfbec chore: update dependencies
Build CI Images / build-ci-base (push) Failing after 26s
Release / release (push) Failing after 14s
Fixes #16

Updated packages:
- @prisma/adapter-pg: 7.6.0 -> 7.8.0
- @prisma/client: 7.6.0 -> 7.8.0
- better-auth: 1.5.6 -> 1.6.9
- next: 16.2.1 -> 16.2.4
- prisma: 7.6.0 -> 7.8.0
- react: 19.2.4 -> 19.2.5
- react-dom: 19.2.4 -> 19.2.5
- @playwright/test: 1.58.2 -> 1.59.1
- tailwindcss: 4.2.2 -> 4.2.4
- react-hook-form: 7.72.0 -> 7.74.0
- And 74 other packages

All 27 Cucumber scenarios pass after update.
2026-04-27 03:14:44 +00:00
Gitea Actions 57b2bb760e chore: bump version to v0.1.10 2026-04-27 03:14:16 +00:00
david ce13bae949 fix: prevent content overflow on right side of screen
Pull Request / unit-tests (pull_request) Successful in 1m5s
Release / release (push) Failing after 16s
Pull Request / e2e-tests (pull_request) Failing after 4m7s
Pull Request / analyze-bump-type (pull_request) Has been skipped
Fixes #23

- Added overflow-x-hidden to body in root layout as defensive measure
- Changed table containers from overflow-hidden to overflow-x-auto
  in admin/players page and RankingsClient (3 tables)
- Added min-w-0 and overflow-hidden to Navigation flex containers
  to prevent links from pushing content off screen
- Added flex-shrink-0 to EuchreCamp wordmark link
2026-04-27 03:12:53 +00:00
Gitea Actions 48730fcf26 chore: bump version to v0.1.9 2026-04-27 02:39:24 +00:00
david 36339d7914 test: remove migrated Playwright tests (epic3-rankings, home-page)
Release / release (push) Failing after 11s
These tests have been migrated to Cucumber feature files:
- epic3-rankings.test.ts -> rankings.feature
- home-page.test.ts -> home-page.feature
2026-04-26 19:39:04 -07:00
14 changed files with 388 additions and 10273 deletions
+6
View File
@@ -16,6 +16,9 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Clear Bun cache
run: bun pm cache rm || true
- name: Install dependencies - name: Install dependencies
run: bun install run: bun install
@@ -38,6 +41,9 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Clear Bun cache
run: bun pm cache rm || true
- name: Install dependencies - name: Install dependencies
run: bun install run: bun install
+24
View File
@@ -1,3 +1,27 @@
## [0.1.12] - 2026-04-27
### Patch Changes
- ci: clear Bun cache before install to fix integrity check failures
## [0.1.11] - 2026-04-27
### Patch Changes
## [0.1.10] - 2026-04-27
### Patch Changes
- fix: prevent content overflow on right side of screen
## [0.1.9] - 2026-04-27
### Patch Changes
- test: remove migrated Playwright tests (epic3-rankings, home-page)
## [0.1.8] - 2026-04-27 ## [0.1.8] - 2026-04-27
### Patch Changes ### Patch Changes
+222 -222
View File
File diff suppressed because it is too large Load Diff
@@ -9,7 +9,7 @@ Feature: Player Schedule
When I go to my schedule page When I go to my schedule page
Then I should see "No upcoming matches" Then I should see "No upcoming matches"
@happy-path @player-features @issue-9 @wip @happy-path @player-features @issue-9
Scenario: Player views schedule with upcoming matches Scenario: Player views schedule with upcoming matches
Given I am logged in as a player Given I am logged in as a player
And I have upcoming matches in my schedule And I have upcoming matches in my schedule
+60 -9
View File
@@ -337,16 +337,67 @@ When('I go to my schedule page', async function () {
}); });
Given('I have upcoming matches in my schedule', async function () { Given('I have upcoming matches in my schedule', async function () {
console.log('🌍 Note: This step requires database setup via API or UI'); console.log('🌍 Setting up upcoming matches in schedule');
console.log('🌍 For acceptance tests, this would be set up before running the test'); const prisma = await world.getPrisma();
// For true acceptance testing, we would: const timestamp = Date.now();
// 1. Create a tournament
// 2. Add the player as a participant
// 3. Generate a schedule
// 4. The match would then appear in the player's schedule
// For now, this is a placeholder that indicates data setup is needed // Get the current player
// In a real test run, this data would already exist in the dev database if (!world.playerId) {
throw new Error('No player ID found. Make sure user is logged in as a player first.');
}
const currentPlayerId = parseInt(world.playerId, 10);
// Create 3 other players for the match
const opponent1 = await prisma.player.create({
data: {
name: `Opponent ${timestamp} 1`,
normalizedName: `opponent ${timestamp} 1`,
currentElo: 1000,
},
});
const opponent2 = await prisma.player.create({
data: {
name: `Opponent ${timestamp} 2`,
normalizedName: `opponent ${timestamp} 2`,
currentElo: 1000,
},
});
const partner1 = await prisma.player.create({
data: {
name: `Partner ${timestamp}`,
normalizedName: `partner ${timestamp}`,
currentElo: 1000,
},
});
// Create a tournament
const tournament = await prisma.event.create({
data: {
name: `Test Schedule Tournament ${timestamp}`,
eventDate: new Date(Date.now() + 86400000), // Tomorrow
status: 'planned',
},
});
// Create a match with the current player as player1P1 (played tomorrow)
await prisma.match.create({
data: {
eventId: tournament.id,
player1P1Id: currentPlayerId,
player1P2Id: partner1.id,
player2P1Id: opponent1.id,
player2P2Id: opponent2.id,
team1Score: 10,
team2Score: 5,
status: 'completed',
playedAt: new Date(Date.now() + 86400000), // Tomorrow
},
});
console.log(`🌍 Created tournament "${tournament.name}" with 1 match for player ${currentPlayerId}`);
}); });
/** /**
@@ -599,3 +599,50 @@ Then('I should see the rankings table', async function () {
await expect(world.page.locator('table')).toBeVisible(); await expect(world.page.locator('table')).toBeVisible();
console.log('🌍 Verified rankings table is visible'); console.log('🌍 Verified rankings table is visible');
}); });
// Player Schedule Steps
Then('I should see the match date', async function () {
// Check for a date-like pattern on the page
const content = await world.page.content();
const hasDate = content.match(/\d{1,2}\/\d{1,2}\/\d{4}/) || content.match(/\w+ \d{1,2}, \d{4}/);
expect(hasDate).toBeTruthy();
console.log('🌍 Verified match date is visible');
});
Then('I should see my opponent\'s name', async function () {
// Check for opponent text on the page
const content = await world.page.content();
const hasOpponent = content.includes('Opponent');
expect(hasOpponent).toBe(true);
console.log('🌍 Verified opponent name is visible');
});
Then('I should see my partner\'s name', async function () {
// Check for partner text on the page
const content = await world.page.content();
const hasPartner = content.includes('Partner');
expect(hasPartner).toBe(true);
console.log('🌍 Verified partner name is visible');
});
Then('I should see the tournament name', async function () {
// Check for tournament name on the page
const content = await world.page.content();
const hasTournament = content.includes('Test Schedule Tournament');
expect(hasTournament).toBe(true);
console.log('🌍 Verified tournament name is visible');
});
When('I click on a match', async function () {
// Click on the first match link
const matchLink = world.page.locator('a[href*="/matches/"]').first();
await matchLink.click();
await world.page.waitForLoadState('domcontentloaded');
console.log('🌍 Clicked on match');
});
Then('I should be on the match detail page', async function () {
const currentUrl = world.page.url();
console.log(`🌍 Checking current URL: ${currentUrl}`);
expect(currentUrl).toMatch(/\/matches\/\d+/);
});
-47
View File
@@ -1,47 +0,0 @@
/**
* Epic 3: Rankings & Public Data
* Acceptance Test: Player Rankings Page
*
* User Story: As a visitor, I want to view player rankings so that I can see top players
*
* Acceptance Criteria:
* - Sortable rankings table
* - Columns: Rank, Name, Elo, Win Rate, Games Played
* - Search/filter functionality
* - Pagination
*/
import { test, expect } from '@playwright/test';
test.describe('Epic 3: Rankings Page', () => {
test('Rankings page loads and displays rankings table', async ({ page }) => {
await page.goto('http://localhost:3000/rankings');
// Check page title or heading
await expect(page.locator('h1, h2')).toContainText(/rankings?/i);
// Check for rankings table
await expect(page.locator('table')).toBeVisible();
});
test('Rankings table displays player columns', async ({ page }) => {
await page.goto('http://localhost:3000/rankings');
// Check for expected column headers
const table = page.locator('table');
await expect(table).toBeVisible();
// Check for column headers (may vary based on implementation)
const headerCount = await page.locator('th').count();
expect(headerCount).toBeGreaterThan(0);
});
test('Rankings page is publicly accessible (no login required)', async ({ page }) => {
// Navigate directly to rankings without logging in
await page.goto('http://localhost:3000/rankings');
// Page should load without redirecting to login
await expect(page).toHaveURL(/.*rankings.*/);
await expect(page.locator('body')).toBeVisible();
});
});
-126
View File
@@ -1,126 +0,0 @@
import { test, expect } from '@playwright/test'
import { prisma } from '@/lib/prisma'
import { createTestPlayer, cleanupTestRecords, getCreatedRecordCounts } from '@/__tests__/test-utils'
test.describe('Home Page', () => {
test.beforeEach(async () => {
// Clean up any existing test records before each test
await cleanupTestRecords();
});
test.afterEach(async () => {
// Clean up test records after each test
await cleanupTestRecords();
});
test('should display top 10 players', async ({ page }) => {
// Create some test players with unique names and very high Elo to ensure they're in top 10
const timestamp = Date.now()
const players = []
for (let i = 0; i < 3; i++) {
const playerName = `Home Test Player ${timestamp} ${i + 1}`
const player = await createTestPlayer({
name: playerName,
currentElo: 2000 - i * 10,
})
players.push(player)
}
// Navigate to home page
await page.goto('/')
// Check that the page loads
await expect(page.locator('text=Top 10 Players')).toBeVisible()
// Check that at least one of our test players is displayed
// Use a more specific locator to avoid multiple matches
await expect(
page.locator(`a:has-text("Home Test Player ${timestamp} 1")`)
).toBeVisible()
// Verify cleanup will work
const counts = getCreatedRecordCounts();
expect(counts.players).toBe(3);
})
test('should display club president', async ({ page }) => {
const timestamp = Date.now()
// Create a club admin user
const clubAdmin = await prisma.user.create({
data: {
email: `president-${timestamp}@example.com`,
name: `Club President ${timestamp}`,
role: 'club_admin',
},
})
// Navigate to home page
await page.goto('/')
// Check that the club president section is visible
await expect(page.locator('text=Club President')).toBeVisible()
// Clean up
await prisma.user.delete({ where: { id: clubAdmin.id } })
})
test('should display most recent tournament', async ({ page }) => {
const timestamp = Date.now()
// Create a tournament with a future date to ensure it's the most recent
const tournament = await prisma.event.create({
data: {
name: `Recent Tournament ${timestamp}`,
eventType: 'tournament',
eventDate: new Date(Date.now() + 86400000), // Tomorrow
status: 'completed',
},
})
// Create players for the match
const player1Name = `Home Match Player 1 ${timestamp}`
const player1 = await prisma.player.create({
data: { name: player1Name, normalizedName: player1Name.toLowerCase(), currentElo: 1500 },
})
const player2Name = `Home Match Player 2 ${timestamp}`
const player2 = await prisma.player.create({
data: { name: player2Name, normalizedName: player2Name.toLowerCase(), currentElo: 1480 },
})
const player3Name = `Home Match Player 3 ${timestamp}`
const player3 = await prisma.player.create({
data: { name: player3Name, normalizedName: player3Name.toLowerCase(), currentElo: 1450 },
})
const player4Name = `Home Match Player 4 ${timestamp}`
const player4 = await prisma.player.create({
data: { name: player4Name, normalizedName: player4Name.toLowerCase(), currentElo: 1420 },
})
// Create a match in the tournament
await prisma.match.create({
data: {
eventId: tournament.id,
player1P1Id: player1.id,
player1P2Id: player2.id,
player2P1Id: player3.id,
player2P2Id: player4.id,
team1Score: 10,
team2Score: 5,
status: 'completed',
playedAt: new Date(),
},
})
// Navigate to home page
await page.goto('/')
// Check that the tournament section is visible
await expect(page.locator('text=Most Recent Tournament')).toBeVisible()
await expect(page.locator(`text=Recent Tournament ${timestamp}`)).toBeVisible()
// Clean up
await prisma.match.deleteMany({ where: { eventId: tournament.id } })
await prisma.event.delete({ where: { id: tournament.id } })
await prisma.player.deleteMany({
where: { id: { in: [player1.id, player2.id, player3.id, player4.id] } },
})
})
})
-9840
View File
File diff suppressed because it is too large Load Diff
+19 -19
View File
@@ -1,6 +1,6 @@
{ {
"name": "euchre_camp", "name": "euchre_camp",
"version": "0.1.8", "version": "0.1.12",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "NEXT_PUBLIC_GIT_COMMIT=$(git rev-parse --short HEAD) next dev", "dev": "NEXT_PUBLIC_GIT_COMMIT=$(git rev-parse --short HEAD) next dev",
@@ -44,35 +44,35 @@
}, },
"dependencies": { "dependencies": {
"@hookform/resolvers": "^5.2.2", "@hookform/resolvers": "^5.2.2",
"@prisma/adapter-pg": "^7.6.0", "@prisma/adapter-pg": "^7.8.0",
"@prisma/client": "^7.6.0", "@prisma/client": "^7.8.0",
"@types/bcryptjs": "^2.4.6", "@types/bcryptjs": "^2.4.6",
"bcrypt": "^6.0.0", "bcrypt": "^6.0.0",
"bcryptjs": "^3.0.3", "bcryptjs": "^3.0.3",
"better-auth": "^1.5.6", "better-auth": "^1.6.9",
"glicko2": "^1.2.1", "glicko2": "^1.2.1",
"jose": "^6.2.2", "jose": "^6.2.2",
"next": "^16.2.1", "next": "^16.2.4",
"openskill": "^4.1.1", "openskill": "^4.1.1",
"papaparse": "^5.5.3", "papaparse": "^5.5.3",
"pg": "^8.20.0", "pg": "^8.20.0",
"prisma": "^7.6.0", "prisma": "^7.8.0",
"react": "^19.2.4", "react": "^19.2.5",
"react-dom": "^19.2.4", "react-dom": "^19.2.5",
"react-hook-form": "^7.72.0", "react-hook-form": "^7.74.0",
"zod": "^4.3.6" "zod": "^4.3.6"
}, },
"devDependencies": { "devDependencies": {
"@cucumber/cucumber": "^12.8.2", "@cucumber/cucumber": "^12.8.2",
"@playwright/test": "^1.58.2", "@playwright/test": "^1.59.1",
"@tailwindcss/postcss": "^4", "@tailwindcss/postcss": "^4.2.4",
"@testing-library/jest-dom": "^6.9.1", "@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2", "@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1", "@testing-library/user-event": "^14.6.1",
"@types/bcrypt": "^6.0.0", "@types/bcrypt": "^6.0.0",
"@types/bun": "^1.3.11", "@types/bun": "^1.3.13",
"@types/jsdom": "^28.0.1", "@types/jsdom": "^28.0.1",
"@types/node": "^20", "@types/node": "^20.19.39",
"@types/papaparse": "^5.5.2", "@types/papaparse": "^5.5.2",
"@types/pg": "^8.20.0", "@types/pg": "^8.20.0",
"@types/react": "^19.2.14", "@types/react": "^19.2.14",
@@ -80,12 +80,12 @@
"@vitejs/plugin-react": "^6.0.1", "@vitejs/plugin-react": "^6.0.1",
"argon2": "^0.44.0", "argon2": "^0.44.0",
"cucumber-pretty": "^6.0.1", "cucumber-pretty": "^6.0.1",
"eslint": "^8.57.0", "eslint": "^8.57.1",
"eslint-config-next": "^16.2.1", "eslint-config-next": "^16.2.4",
"jsdom": "^29.0.1", "jsdom": "^29.1.0",
"tailwindcss": "^4", "tailwindcss": "^4.2.4",
"tsx": "^4.21.0", "tsx": "^4.21.0",
"typescript": "^5", "typescript": "^5.9.3",
"vitest": "^4.1.2" "vitest": "^4.1.5"
} }
} }
+1 -1
View File
@@ -258,7 +258,7 @@ export default function AdminPlayersPage() {
</div> </div>
{/* Player Table */} {/* Player Table */}
<div className="bg-white shadow rounded-lg overflow-hidden"> <div className="bg-white shadow rounded-lg overflow-x-auto">
<table className="min-w-full divide-y divide-gray-200"> <table className="min-w-full divide-y divide-gray-200">
<thead className="bg-gray-50"> <thead className="bg-gray-50">
<tr> <tr>
+1 -1
View File
@@ -22,7 +22,7 @@ export default function RootLayout({
lang="en" lang="en"
className={`${inter.variable} h-full antialiased`} className={`${inter.variable} h-full antialiased`}
> >
<body className="min-h-full flex flex-col"> <body className="min-h-full flex flex-col overflow-x-hidden">
<SessionProvider> <SessionProvider>
{children} {children}
<Footer /> <Footer />
+3 -3
View File
@@ -59,7 +59,7 @@ export default function RankingsClient({ players }: { players: PlayerWithRatings
{/* Elo Rating Tab */} {/* Elo Rating Tab */}
{activeTab === "elo" && ( {activeTab === "elo" && (
<div className="bg-white shadow overflow-hidden sm:rounded-lg"> <div className="bg-white shadow overflow-x-auto sm:rounded-lg">
<h2 className="text-xl font-semibold text-gray-900 px-6 py-4 border-b"> <h2 className="text-xl font-semibold text-gray-900 px-6 py-4 border-b">
Elo Rating Rankings Elo Rating Rankings
</h2> </h2>
@@ -117,7 +117,7 @@ export default function RankingsClient({ players }: { players: PlayerWithRatings
{/* OpenSkill Rating Tab */} {/* OpenSkill Rating Tab */}
{activeTab === "openskill" && ( {activeTab === "openskill" && (
<div className="bg-white shadow overflow-hidden sm:rounded-lg"> <div className="bg-white shadow overflow-x-auto sm:rounded-lg">
<h2 className="text-xl font-semibold text-gray-900 px-6 py-4 border-b"> <h2 className="text-xl font-semibold text-gray-900 px-6 py-4 border-b">
OpenSkill Rating Rankings OpenSkill Rating Rankings
</h2> </h2>
@@ -178,7 +178,7 @@ export default function RankingsClient({ players }: { players: PlayerWithRatings
{/* Glicko2 Rating Tab */} {/* Glicko2 Rating Tab */}
{activeTab === "glicko2" && ( {activeTab === "glicko2" && (
<div className="bg-white shadow overflow-hidden sm:rounded-lg"> <div className="bg-white shadow overflow-x-auto sm:rounded-lg">
<h2 className="text-xl font-semibold text-gray-900 px-6 py-4 border-b"> <h2 className="text-xl font-semibold text-gray-900 px-6 py-4 border-b">
Glicko2 Rating Rankings Glicko2 Rating Rankings
</h2> </h2>
+4 -4
View File
@@ -50,14 +50,14 @@ export default function Navigation() {
<nav className="bg-white shadow-sm"> <nav className="bg-white shadow-sm">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="flex justify-between h-16"> <div className="flex justify-between h-16">
<div className="flex items-center"> <div className="flex items-center min-w-0 overflow-hidden">
<Link <Link
href="/wordmark-redirect" href="/wordmark-redirect"
className="text-xl font-bold text-gray-900 no-underline" className="text-xl font-bold text-gray-900 no-underline flex-shrink-0"
> >
EuchreCamp EuchreCamp
</Link> </Link>
<div className="hidden md:ml-6 md:flex md:space-x-8"> <div className="hidden md:ml-6 md:flex md:space-x-8 min-w-0 overflow-hidden">
<Link <Link
href="/rankings" href="/rankings"
className="border-transparent text-gray-500 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium" className="border-transparent text-gray-500 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"
@@ -110,7 +110,7 @@ export default function Navigation() {
)} )}
</div> </div>
</div> </div>
<div className="flex items-center"> <div className="flex items-center min-w-0 overflow-hidden">
{loading ? ( {loading ? (
<div className="text-gray-500">Loading...</div> <div className="text-gray-500">Loading...</div>
) : session ? ( ) : session ? (