Skip to content

Commit

Permalink
Add a test to demonstrate removing a participant from the seeding
Browse files Browse the repository at this point in the history
  • Loading branch information
Drarig29 committed Mar 16, 2022
1 parent 60088b2 commit 6319cb4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/update.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,23 @@ describe('Seeding', () => {
assert.strictEqual((await storage.select('participant')).length, 8);
});

it('should update the seeding to remove participants', async () => {
await manager.update.seeding(0, [
'Team 1', 'Team 2',
null, 'Team 4',
'Team 5', 'Team 6',
'Team 7', null,
]);

assert.strictEqual((await storage.select('match', 0)).opponent1.id, 0);

// In this context, a `null` value is not a BYE, but a TDB (to be determined)
// because we consider the tournament might have been started.
// If it's not and you prefer BYEs, just recreate the tournament.
assert.strictEqual((await storage.select('match', 1)).opponent1.id, null);
assert.strictEqual((await storage.select('match', 3)).opponent2.id, null);
});

it('should reset the seeding of a stage', async () => {
await manager.update.seeding(0, [
'Team 1', 'Team 2',
Expand Down

0 comments on commit 6319cb4

Please sign in to comment.