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 apiPath = fileURLToPath(new URL("../src/api/scheduling.ts", import.meta.url)); const page = readFileSync(pagePath, "utf8"); const api = readFileSync(apiPath, "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, /className="scheduling-full-editor"/); assert.match(page, /className="scheduling-page-actions"/); const editorActions = page.slice( page.indexOf('
'), page.indexOf('
', page.indexOf('
')) ); assert.ok(editorActions.indexOf("I18N.discard") < editorActions.indexOf("I18N.save")); assert.match(page, /