Skip to content

Commit 6366b65

Browse files
authored
Merge pull request #6 from chamika/copilot/sub-pr-5
Fix review feedback: remove unused imports and redundant test conditions
2 parents b8bb775 + f022e34 commit 6366b65

5 files changed

Lines changed: 6 additions & 14 deletions

File tree

worker/package-lock.json

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

worker/seed.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ INSERT INTO teams (id, name, elttl_url, created_at, updated_at)
1313
VALUES (
1414
'00000000-0000-0000-0000-000000000000',
1515
'Test Team E2E',
16-
'https://www.elttl.co.uk/Availability.aspx?FixtureId=0&TeamId=999',
16+
'https://elttl.interactive.co.uk/teams/view/999',
1717
strftime('%s', 'now'),
1818
strftime('%s', 'now')
1919
);

worker/src/database.integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
1+
import { describe, it, expect, beforeEach } from 'vitest';
22
import { DatabaseService } from './database';
33

44
// Note: These are integration tests that require a real D1 database instance

worker/src/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Env, Team, Fixture, Player, Availability, FinalSelection } from './types';
2-
import { generateUUID, now, isPastDate, getAvailabilityKey } from './utils';
2+
import { generateUUID, now, isPastDate } from './utils';
33

44
/**
55
* Database service for D1 operations

worker/src/validation.test.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,7 @@ describe('Player Summary Calculations', () => {
225225
const gamesScheduled = 3;
226226
const totalGames = gamesPlayed + gamesScheduled; // 8
227227

228-
const selectionRate = totalGames > 0
229-
? Math.round((gamesScheduled / totalGames) * 100)
230-
: 0;
228+
const selectionRate = Math.round((gamesScheduled / totalGames) * 100);
231229

232230
expect(selectionRate).toBe(38); // 3/8 = 37.5% rounds to 38%
233231
});
@@ -244,13 +242,10 @@ describe('Player Summary Calculations', () => {
244242
});
245243

246244
it('should calculate 100% selection rate', () => {
247-
const gamesPlayed = 0;
248245
const gamesScheduled = 5;
249-
const totalGames = gamesScheduled;
246+
const totalGames = 5;
250247

251-
const selectionRate = totalGames > 0
252-
? Math.round((gamesScheduled / totalGames) * 100)
253-
: 0;
248+
const selectionRate = Math.round((gamesScheduled / totalGames) * 100);
254249

255250
expect(selectionRate).toBe(100);
256251
});

0 commit comments

Comments
 (0)