Fix flightStatusVisibility test to use timezone-stable dates
This commit is contained in:
+4
-3
@@ -44,10 +44,11 @@ describe("canViewFlightStatus", () => {
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("returns false when departure is not same day as now (UTC)", () => {
|
||||
const now = new Date("2026-04-17T23:59:59Z");
|
||||
it("returns false when departure is not same day as now", () => {
|
||||
const now = new Date("2026-04-17T12:00:00Z");
|
||||
// Departure 2 days later — definitively different calendar day in any timezone
|
||||
expect(
|
||||
canViewFlightStatus(makeFlight("SU", "2026-04-18T00:30:00Z"), now, 24, AIRLINES_WITH_STATUS),
|
||||
canViewFlightStatus(makeFlight("SU", "2026-04-19T12:00:00Z"), now, 24, AIRLINES_WITH_STATUS),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user