feat(admin): show group schedule status
CI / validate (push) Successful in 6m9s
Release / release (push) Successful in 7m51s

This commit is contained in:
dmg
2026-08-02 14:26:24 -04:00
parent c131465ff5
commit 6fa33c9f7b
6 changed files with 26 additions and 6 deletions
+7
View File
@@ -1,6 +1,7 @@
import { describe, expect, it } from "vitest";
import {
evaluateGroupSchedule,
groupScheduleStatus,
localWindowToUtc,
parseScheduleWindows,
utcWindowToLocal,
@@ -13,6 +14,12 @@ const fridayEvening: WeeklyAccessWindow = {
};
describe("weekly group access schedules", () => {
it("summarizes whether a group has configured windows", () => {
expect(groupScheduleStatus(0)).toBe("Unrestricted");
expect(groupScheduleStatus(1)).toBe("1 window");
expect(groupScheduleStatus(3)).toBe("3 windows");
});
it("allows an enabled group at any time when no schedule is configured", () => {
expect(evaluateGroupSchedule([], new Date("2026-08-07T19:00:00Z"))).toEqual({
allowed: true,