repositories / dotfiles
dotfiles
bugabingas dorkfiles
owned by admin
quickshell/nuguland/features/clock/clock-panel.test.mjs
Rawimport assert from "node:assert/strict";
import { readFileSync } from "node:fs";
// Source conventions and paths no fixture reaches; `just load-test clock` and
// `just ui-test clock` prove the registry wiring, service bindings and drafts.
const clock = readFileSync(new URL("ClockPanel.qml", import.meta.url), "utf8");
for (const [property, type] of Object.entries({ theme: "Theme", timeService: "Time", caldavService: "CalDav" }))
assert.match(clock, new RegExp(`required property ${type} ${property}\\b`));
assert.doesNotMatch(clock, /childrenRect|\bsurfaces\b|\bbarWindow\b/, "panel has no host geometry dependency");
assert.match(clock, /signal configureRequested/);
assert.match(clock, /root\.caldavService\.stale/);
assert.doesNotMatch(clock, /SetupField|saveSetup/);
assert.match(clock, /height: Math\.max\(Math\.min\(70, agendaCol\.height\), parent \? parent\.height - y - configure\.height - root\.spacing : agendaCol\.height\)/);
// The card fits the agenda; the agenda's height never feeds back into it.
assert.match(clock, /naturalHeight: agendaFrame\.y \+ agendaCol\.height \+ configure\.height \+ spacing/);
console.log("clock-panel.test.mjs: ALL PASS");