Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions worker/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion worker/seed.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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')
);
Expand Down
2 changes: 1 addition & 1 deletion worker/src/database.integration.test.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion worker/src/database.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 3 additions & 8 deletions worker/src/validation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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%
});
Expand All @@ -244,13 +242,10 @@ describe('Player Summary Calculations', () => {
});

it('should calculate 100% selection rate', () => {
const gamesPlayed = 0;
const gamesScheduled = 5;
const totalGames = gamesScheduled;
const totalGames = 5;

const selectionRate = totalGames > 0
? Math.round((gamesScheduled / totalGames) * 100)
: 0;
const selectionRate = Math.round((gamesScheduled / totalGames) * 100);

expect(selectionRate).toBe(100);
});
Expand Down