import assert from "node:assert/strict"; import { readFileSync } from "node:fs"; import { fileURLToPath } from "node:url"; const pagePath = fileURLToPath(new URL("../src/features/scheduling/SchedulingPage.tsx", import.meta.url)); const publicPagePath = fileURLToPath(new URL("../src/features/scheduling/SchedulingPublicPage.tsx", import.meta.url)); const apiPath = fileURLToPath(new URL("../src/api/scheduling.ts", import.meta.url)); const modulePath = fileURLToPath(new URL("../src/module.ts", import.meta.url)); const page = readFileSync(pagePath, "utf8"); const publicPage = readFileSync(publicPagePath, "utf8"); const api = readFileSync(apiPath, "utf8"); const moduleSource = readFileSync(modulePath, "utf8"); assert.match(page, /usePlatformUiCapability\("calendar\.picker"\)/); assert.match(page, /hasScope\(auth, "calendar:calendar:read"\)/); assert.match(page, /Boolean\(calendarPickerCapability\) && canReadCalendars && canReadAvailability && canWriteCalendarEvent/); assert.doesNotMatch(page, /@govoplan\/calendar-webui|govoplan-calendar\/webui/); assert.match(page, /Card,[\s\S]*DataGrid,[\s\S]*DataGridRowActions,[\s\S]*FormField,[\s\S]*MetricCard,[\s\S]*PasswordField,[\s\S]*PeoplePicker,[\s\S]*SelectionList,[\s\S]*ToggleSwitch,[\s\S]*from "@govoplan\/core-webui"/); assert.doesNotMatch(page, /@govoplan\/core-webui\/src\//); assert.match(page, /className="scheduling-workspace-layout"/); assert.match(page, /