mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-13 14:46:10 -05:00
Don't show rosters as skipped on All rosters tab
This commit is contained in:
@@ -277,6 +277,14 @@ describe("LeaderboardRepository.findTeamLeaderboardBySeason", () => {
|
||||
})
|
||||
).map((entry) => [entry.identifier, entry.placementRank]);
|
||||
|
||||
const allRostersPlacements = async () =>
|
||||
(
|
||||
await LeaderboardRepository.findTeamLeaderboardBySeason({
|
||||
season: SEASON,
|
||||
onlyOneEntryPerUser: false,
|
||||
})
|
||||
).map((entry) => [entry.identifier, entry.placementRank, entry.isSkipped]);
|
||||
|
||||
beforeEach(async () => {
|
||||
await users.create(9);
|
||||
await playSeasonInWith(topRoster());
|
||||
@@ -300,6 +308,16 @@ describe("LeaderboardRepository.findTeamLeaderboardBySeason", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
test("places a skipped team normally on the all rosters leaderboard", async () => {
|
||||
await skipTeam(topRoster());
|
||||
|
||||
expect(await allRostersPlacements()).toEqual([
|
||||
[userIdsToIdentifier(topRoster()), 1, false],
|
||||
[userIdsToIdentifier(sharedPlayersRoster()), 2, false],
|
||||
[userIdsToIdentifier(beatenRoster()), 3, false],
|
||||
]);
|
||||
});
|
||||
|
||||
test("gives a team its placement back when it is unskipped", async () => {
|
||||
await skipTeam(topRoster());
|
||||
await LeaderboardRepository.deleteTeamSkip({
|
||||
|
||||
@@ -121,9 +121,12 @@ export async function findTeamLeaderboardBySeason({
|
||||
season: number;
|
||||
onlyOneEntryPerUser: boolean;
|
||||
}) {
|
||||
// skipping is about the season finale qualification which the all rosters leaderboard is not concerned with
|
||||
const entries = addSkipped({
|
||||
entries: await teamLeaderboardBySeasonQuery(season).execute(),
|
||||
skippedIdentifiers: await findAllTeamSkipIdentifiersBySeason(season),
|
||||
skippedIdentifiers: onlyOneEntryPerUser
|
||||
? await findAllTeamSkipIdentifiersBySeason(season)
|
||||
: new Set<SkillTeamIdentifier>(),
|
||||
});
|
||||
const withNonSqPlayersHandled = onlyOneEntryPerUser
|
||||
? await filterOutNonSqPlayers({ season, entries })
|
||||
|
||||
Reference in New Issue
Block a user