From 00f383ef9a125ae615cdec4b3289d1704ceadee7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 31 Dec 2025 00:42:06 +0000 Subject: [PATCH 1/3] Initial plan From 6ac1cdaffbe59c4ea42e9da3474b475170207b6e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 31 Dec 2025 00:44:45 +0000 Subject: [PATCH 2/3] Fix review comments: remove unused imports and fix test conditions Co-authored-by: chamika <754909+chamika@users.noreply.github.com> --- worker/package-lock.json | 3 --- worker/seed.sql | 2 +- worker/src/database.integration.test.ts | 2 +- worker/src/database.ts | 2 +- worker/src/validation.test.ts | 9 ++------- 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/worker/package-lock.json b/worker/package-lock.json index e0bf723..863e78e 100644 --- a/worker/package-lock.json +++ b/worker/package-lock.json @@ -2099,7 +2099,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -2378,7 +2377,6 @@ "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "pathe": "^2.0.3" } @@ -2389,7 +2387,6 @@ "integrity": "sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", diff --git a/worker/seed.sql b/worker/seed.sql index 09fce8a..0d192e1 100644 --- a/worker/seed.sql +++ b/worker/seed.sql @@ -13,7 +13,7 @@ INSERT INTO teams (id, name, elttl_url, created_at, updated_at) VALUES ( '00000000-0000-0000-0000-000000000000', 'Test Team E2E', - 'https://www.elttl.co.uk/Availability.aspx?FixtureId=0&TeamId=999', + 'https://elttl.interactive.co.uk/teams/view/999', strftime('%s', 'now'), strftime('%s', 'now') ); diff --git a/worker/src/database.integration.test.ts b/worker/src/database.integration.test.ts index 9470e1c..13ef74d 100644 --- a/worker/src/database.integration.test.ts +++ b/worker/src/database.integration.test.ts @@ -1,4 +1,4 @@ -import { describe, it, expect, beforeEach, afterEach } from 'vitest'; +import { describe, it, expect, beforeEach } from 'vitest'; import { DatabaseService } from './database'; // Note: These are integration tests that require a real D1 database instance diff --git a/worker/src/database.ts b/worker/src/database.ts index ce6c471..6c61d25 100644 --- a/worker/src/database.ts +++ b/worker/src/database.ts @@ -1,5 +1,5 @@ import type { Env, Team, Fixture, Player, Availability, FinalSelection } from './types'; -import { generateUUID, now, isPastDate, getAvailabilityKey } from './utils'; +import { generateUUID, now, isPastDate } from './utils'; /** * Database service for D1 operations diff --git a/worker/src/validation.test.ts b/worker/src/validation.test.ts index 69bf13b..ad06388 100644 --- a/worker/src/validation.test.ts +++ b/worker/src/validation.test.ts @@ -225,9 +225,7 @@ describe('Player Summary Calculations', () => { const gamesScheduled = 3; const totalGames = gamesPlayed + gamesScheduled; // 8 - const selectionRate = totalGames > 0 - ? Math.round((gamesScheduled / totalGames) * 100) - : 0; + const selectionRate = Math.round((gamesScheduled / totalGames) * 100); expect(selectionRate).toBe(38); // 3/8 = 37.5% rounds to 38% }); @@ -244,13 +242,10 @@ describe('Player Summary Calculations', () => { }); it('should calculate 100% selection rate', () => { - const gamesPlayed = 0; const gamesScheduled = 5; const totalGames = gamesScheduled; - const selectionRate = totalGames > 0 - ? Math.round((gamesScheduled / totalGames) * 100) - : 0; + const selectionRate = Math.round((gamesScheduled / totalGames) * 100); expect(selectionRate).toBe(100); }); From f022e34d4c20e39e3df675b94cb094fdace35ebb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 31 Dec 2025 00:45:32 +0000 Subject: [PATCH 3/3] Make test intent clearer by using explicit values Co-authored-by: chamika <754909+chamika@users.noreply.github.com> --- worker/src/validation.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/src/validation.test.ts b/worker/src/validation.test.ts index ad06388..295e8a8 100644 --- a/worker/src/validation.test.ts +++ b/worker/src/validation.test.ts @@ -243,7 +243,7 @@ describe('Player Summary Calculations', () => { it('should calculate 100% selection rate', () => { const gamesScheduled = 5; - const totalGames = gamesScheduled; + const totalGames = 5; const selectionRate = Math.round((gamesScheduled / totalGames) * 100);