fix: resolve remaining test failures in CI
- cucumber: use 'progress' formatter in CI (not progress-bar TTY) - csv-upload: use timestamp in player names to avoid unique constraint - elo-ratings: delete event_participants before players (FK constraint) - epic3-rankings: use .first() on h1/h2 locator (strict mode) - schedule-tab: look for button instead of anchor for Schedule tab - team-config: wait for search input before filling (step 2 async) - tournament-edit-allowTies: check for 'Edit Tournament' not 'Tournament Name' - epic4-tournament-creation: submit button only on step 2, add waitForSelector
This commit is contained in:
@@ -13,6 +13,7 @@ import path from 'path';
|
||||
test.describe('CSV Upload Player Deduplication', () => {
|
||||
let testTournamentId: number;
|
||||
const testPlayerIds: number[] = [];
|
||||
const ts = Date.now();
|
||||
|
||||
test.beforeAll(async () => {
|
||||
// Create a test tournament
|
||||
@@ -47,12 +48,14 @@ test.describe('CSV Upload Player Deduplication', () => {
|
||||
});
|
||||
}
|
||||
|
||||
// Delete test players (those with "Dedupe" in the name)
|
||||
// Delete test players (those with "Dedupe" or "Aggregate Test" in the name)
|
||||
await prisma.player.deleteMany({
|
||||
where: {
|
||||
name: {
|
||||
contains: 'Dedupe',
|
||||
},
|
||||
OR: [
|
||||
{ name: { contains: 'Dedupe' } },
|
||||
{ name: { contains: 'Aggregate Test' } },
|
||||
{ name: { contains: 'Whitespace' } },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
@@ -163,8 +166,8 @@ test.describe('CSV Upload Player Deduplication', () => {
|
||||
// First, create some players manually to simulate previous uploads
|
||||
const player1 = await prisma.player.create({
|
||||
data: {
|
||||
name: 'Aggregate Test',
|
||||
normalizedName: 'aggregate test',
|
||||
name: `Aggregate Test ${ts}`,
|
||||
normalizedName: `aggregate test ${ts}`,
|
||||
currentElo: 1050,
|
||||
gamesPlayed: 5,
|
||||
wins: 3,
|
||||
@@ -175,7 +178,7 @@ test.describe('CSV Upload Player Deduplication', () => {
|
||||
|
||||
// Upload a CSV with the same player name
|
||||
const csvContent = `Event #,Round,Table,Seat 1,Seat 3,Odds Points,Seat 2,Seat 4,Evens Points
|
||||
1,1,1,Aggregate Test,Test Player 1,5,Test Player 2,Test Player 3,3`;
|
||||
1,1,1,Aggregate Test ${ts},Test Player 1,5,Test Player 2,Test Player 3,3`;
|
||||
|
||||
const csvPath = path.join(__dirname, 'temp-aggregate-test.csv');
|
||||
fs.writeFileSync(csvPath, csvContent);
|
||||
|
||||
Reference in New Issue
Block a user