Fix non-null assertion lint errors in test assertions

This commit is contained in:
Chris Parsons 2026-04-16 11:11:41 -07:00
parent 34a9d54832
commit ba04e1b24a

View file

@ -259,8 +259,8 @@ describe("getUpcomingEventsForDraftedParticipants — bracket sports", () => {
const arsenalEntry = result.find((r) => r.relevantParticipants.some((p) => p.id === "arsenal")); const arsenalEntry = result.find((r) => r.relevantParticipants.some((p) => p.id === "arsenal"));
expect(manCityEntry).toBeDefined(); expect(manCityEntry).toBeDefined();
expect(arsenalEntry).toBeDefined(); expect(arsenalEntry).toBeDefined();
expect(manCityEntry!.relevantParticipants).toHaveLength(1); expect(manCityEntry?.relevantParticipants).toHaveLength(1);
expect(arsenalEntry!.relevantParticipants).toHaveLength(1); expect(arsenalEntry?.relevantParticipants).toHaveLength(1);
}); });
it("only includes drafted participants in relevantParticipants, not opponents", async () => { it("only includes drafted participants in relevantParticipants, not opponents", async () => {
@ -512,10 +512,10 @@ describe("getUpcomingEventsForDraftedParticipants — bracket sports", () => {
const higginsEntry = result.find((r) => r.relevantParticipants.some((p) => p.id === "john-higgins")); const higginsEntry = result.find((r) => r.relevantParticipants.some((p) => p.id === "john-higgins"));
expect(williamsEntry).toBeDefined(); expect(williamsEntry).toBeDefined();
expect(higginsEntry).toBeDefined(); expect(higginsEntry).toBeDefined();
expect(williamsEntry!.earliestGameTime).toBe(time1.toISOString()); expect(williamsEntry?.earliestGameTime).toBe(time1.toISOString());
expect(higginsEntry!.earliestGameTime).toBe(time2.toISOString()); expect(higginsEntry?.earliestGameTime).toBe(time2.toISOString());
expect(williamsEntry!.matchLabel).toBe("Round of 32"); expect(williamsEntry?.matchLabel).toBe("Round of 32");
expect(higginsEntry!.matchLabel).toBe("Round of 32"); expect(higginsEntry?.matchLabel).toBe("Round of 32");
}); });
it("all-compete events have null earliestGameTime and matchLabel", async () => { it("all-compete events have null earliestGameTime and matchLabel", async () => {