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:
+30
-12
@@ -13,24 +13,33 @@ import path from 'path';
|
||||
test.describe('Elo Rating Updates', () => {
|
||||
test.beforeAll(async () => {
|
||||
// Clean up any existing test data
|
||||
const playerIds = await getEloTestPlayerIds();
|
||||
|
||||
// First delete matches that reference players
|
||||
await prisma.match.deleteMany({
|
||||
where: {
|
||||
OR: [
|
||||
{ player1P1Id: { in: await getEloTestPlayerIds() } },
|
||||
{ player1P2Id: { in: await getEloTestPlayerIds() } },
|
||||
{ player2P1Id: { in: await getEloTestPlayerIds() } },
|
||||
{ player2P2Id: { in: await getEloTestPlayerIds() } },
|
||||
{ player1P1Id: { in: playerIds } },
|
||||
{ player1P2Id: { in: playerIds } },
|
||||
{ player2P1Id: { in: playerIds } },
|
||||
{ player2P2Id: { in: playerIds } },
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
// Then delete event participants that reference players
|
||||
await prisma.eventParticipant.deleteMany({
|
||||
where: {
|
||||
playerId: { in: playerIds }
|
||||
}
|
||||
});
|
||||
|
||||
// Then delete partnerships
|
||||
await prisma.partnershipStat.deleteMany({
|
||||
where: {
|
||||
OR: [
|
||||
{ player1Id: { in: await getEloTestPlayerIds() } },
|
||||
{ player2Id: { in: await getEloTestPlayerIds() } },
|
||||
{ player1Id: { in: playerIds } },
|
||||
{ player2Id: { in: playerIds } },
|
||||
]
|
||||
}
|
||||
});
|
||||
@@ -47,24 +56,33 @@ test.describe('Elo Rating Updates', () => {
|
||||
|
||||
test.afterAll(async () => {
|
||||
// Clean up test data
|
||||
const playerIds = await getEloTestPlayerIds();
|
||||
|
||||
// First delete matches that reference players
|
||||
await prisma.match.deleteMany({
|
||||
where: {
|
||||
OR: [
|
||||
{ player1P1Id: { in: await getEloTestPlayerIds() } },
|
||||
{ player1P2Id: { in: await getEloTestPlayerIds() } },
|
||||
{ player2P1Id: { in: await getEloTestPlayerIds() } },
|
||||
{ player2P2Id: { in: await getEloTestPlayerIds() } },
|
||||
{ player1P1Id: { in: playerIds } },
|
||||
{ player1P2Id: { in: playerIds } },
|
||||
{ player2P1Id: { in: playerIds } },
|
||||
{ player2P2Id: { in: playerIds } },
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
// Then delete event participants that reference players
|
||||
await prisma.eventParticipant.deleteMany({
|
||||
where: {
|
||||
playerId: { in: playerIds }
|
||||
}
|
||||
});
|
||||
|
||||
// Then delete partnerships
|
||||
await prisma.partnershipStat.deleteMany({
|
||||
where: {
|
||||
OR: [
|
||||
{ player1Id: { in: await getEloTestPlayerIds() } },
|
||||
{ player2Id: { in: await getEloTestPlayerIds() } },
|
||||
{ player1Id: { in: playerIds } },
|
||||
{ player2Id: { in: playerIds } },
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user