Diff leaderboard

This commit is contained in:
Kalle
2026-08-16 19:14:22 +03:00
parent 55957f7aca
commit 8da2b66ac6
16 changed files with 177 additions and 18 deletions

View File

@@ -41,9 +41,14 @@ export async function seedMisc({
await seedNotifications(users, tournaments);
await seedUserReports(users, sendouq);
await LiveStreamFactory.replaceAll(
users.showcaseIds.slice(0, STREAM_COUNT).map((userId) => ({ userId })),
);
// the differ seeds a world where nobody is live on Twitch: live-stream chrome
// (sidebar streams, friend stream activity) depends on the tournament cluster,
// which migrates to apps/web in a later wave
if (process.env.SEED_QUIET_WORLD !== "true") {
await LiveStreamFactory.replaceAll(
users.showcaseIds.slice(0, STREAM_COUNT).map((userId) => ({ userId })),
);
}
await SplatoonRotationFactory.replaceAll();
}

View File

@@ -10,6 +10,16 @@ test.describe("Leaderboards", () => {
page,
factories,
}) => {
// season 1 renders its first ten entries through the static top-ten
// showcase (names come from top-ten.json, not the database), so the
// asserted users must rank below ten fillers to appear as normal rows
for (let i = 0; i < 10; i++) {
const filler = await factories.UserFactory.create();
await factories.SkillFactory.create(
{ userId: filler.id, mu: 40 - i },
{ matchesCount: 10 },
);
}
const better = await factories.UserFactory.create({
discordName: "BetterPlayer",
});
@@ -17,7 +27,7 @@ test.describe("Leaderboards", () => {
discordName: "WorsePlayer",
});
await factories.SkillFactory.create(
{ userId: better.id, mu: 30 },
{ userId: better.id, mu: 25 },
{ matchesCount: 10 },
);
await factories.SkillFactory.create(
@@ -52,7 +62,6 @@ test.describe("Leaderboards", () => {
weaponSplId: 40,
});
await factories.XRankPlacementFactory.create({
playerUserId: zonesPlayer.id,
name: LOW_POWER_NAME,
playerSplId: `runner-up-${zonesPlayer.id}`,
mode: "SZ",