b7fea83ed6
Deliver the initial local bridge, Noctalia v4/v5 adapters, desktop client, service unit, tests, and implementation documentation for persistent Pi status and control.
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
import assert from "node:assert/strict";
|
|
import { readFile } from "node:fs/promises";
|
|
import test from "node:test";
|
|
|
|
test("ships a Noctalia plugin with compact bar and presentation-only panel entry points", async () => {
|
|
const manifestText = await readFile(
|
|
"noctalia-plugin/pi-status-bridge/manifest.json",
|
|
"utf8",
|
|
);
|
|
let manifest;
|
|
try {
|
|
manifest = JSON.parse(manifestText);
|
|
} catch (error) {
|
|
assert.fail(
|
|
error instanceof Error ? error.message : "manifest was not valid JSON",
|
|
);
|
|
}
|
|
const [bar, panel, main] = await Promise.all([
|
|
readFile("noctalia-plugin/pi-status-bridge/BarWidget.qml", "utf8"),
|
|
readFile("noctalia-plugin/pi-status-bridge/Panel.qml", "utf8"),
|
|
readFile("noctalia-plugin/pi-status-bridge/Main.qml", "utf8"),
|
|
]);
|
|
|
|
assert.equal(manifest.id, "pi-status-bridge");
|
|
assert.deepEqual(manifest.entryPoints, {
|
|
main: "Main.qml",
|
|
barWidget: "BarWidget.qml",
|
|
panel: "Panel.qml",
|
|
});
|
|
assert.match(bar, /pluginApi\.togglePanel\(root\.screen, visualCapsule\)/);
|
|
assert.match(panel, /allowAttach: true/);
|
|
assert.match(main, /IpcHandler/);
|
|
assert.match(main, /setBridgeState/);
|
|
});
|