diff --git a/app/features/global-status/core/global-status.server.test.ts b/app/features/global-status/core/global-status.server.test.ts index 71680db15..6ce448161 100644 --- a/app/features/global-status/core/global-status.server.test.ts +++ b/app/features/global-status/core/global-status.server.test.ts @@ -5,6 +5,7 @@ import * as SQGroupFactory from "~/db/seed/factories/SQGroupFactory"; import * as SQMatchFactory from "~/db/seed/factories/SQMatchFactory"; import * as SQReadyCheckFactory from "~/db/seed/factories/SQReadyCheckFactory"; import * as TournamentFactory from "~/db/seed/factories/TournamentFactory"; +import * as TournamentLFGTeamFactory from "~/db/seed/factories/TournamentLFGTeamFactory"; import * as TournamentTeamFactory from "~/db/seed/factories/TournamentTeamFactory"; import * as UserFactory from "~/db/seed/factories/UserFactory"; import { refreshSendouQInstance } from "~/features/sendouq/core/SendouQ.server"; @@ -204,6 +205,35 @@ describe("resolveGlobalStatus", () => { expect(await resolveGlobalStatus(users.id(1))).toBeNull(); }); + test("resolves nothing for a solo player looking for a team", async () => { + const { id: tournamentId } = await TournamentFactory.create({ + authorId: users.id(8), + startTimes: [dateToDatabaseTimestamp(addMinutes(new Date(), 30))], + }); + await TournamentLFGTeamFactory.create({ + tournamentId, + userId: users.id(1), + }); + + expect(await resolveGlobalStatus(users.id(1))).toBeNull(); + }); + + test("resolves nothing for a league, which has no check-in", async () => { + const { id: tournamentId } = await TournamentFactory.create( + { + authorId: users.id(8), + startTimes: [dateToDatabaseTimestamp(addMinutes(new Date(), 30))], + }, + { isLeague: true }, + ); + await TournamentTeamFactory.create({ + tournamentId, + memberUserIds: userIds([1, 2, 3, 4]), + }); + + expect(await resolveGlobalStatus(users.id(1))).toBeNull(); + }); + test("resolves nothing while check-in has yet to open", async () => { const { id: tournamentId } = await TournamentFactory.create({ authorId: users.id(8), diff --git a/app/features/tournament/TournamentRepository.server.ts b/app/features/tournament/TournamentRepository.server.ts index 4001b6395..0f18db6a8 100644 --- a/app/features/tournament/TournamentRepository.server.ts +++ b/app/features/tournament/TournamentRepository.server.ts @@ -988,11 +988,17 @@ export function findPendingCheckInsStartingBetween({ .where("CalendarEvent.hidden", "=", 0) .where("Tournament.isFinalized", "=", 0) .where("TournamentTeam.droppedOut", "=", 0) + .where("TournamentTeam.isPlaceholder", "=", 0) .where( sql`json_extract("Tournament"."settings", '$.isTest')`, "is not", 1, ) + .where( + sql`json_extract("Tournament"."settings", '$.isLeague')`, + "is not", + 1, + ) .where( sql`json_extract("Tournament"."settings", '$.isDraft')`, "is not",