feat(admin): show group schedule status
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user