mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 23:25:24 +00:00
feat: make each plugin an npm workspace built by a termix-plugin CLI
This commit is contained in:
1 parent
4758016f41
commit
5796186a1c
448 files changed
+3087
-2003
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
selectTemperatureSensor,
|
||||
temperaturePreferenceKey,
|
||||
} from "../../src/frontend/temperature-preference";
|
||||
|
||||
const sensors = [
|
||||
{ label: "k10temp: Tctl", celsius: 55 },
|
||||
{ label: "nvme-pci-0100: Composite", celsius: 70 },
|
||||
];
|
||||
|
||||
describe("temperature sensor preference", () => {
|
||||
it("selects the configured sensor by its complete label", () => {
|
||||
expect(selectTemperatureSensor(sensors, "k10temp: Tctl")).toEqual(
|
||||
sensors[0],
|
||||
);
|
||||
});
|
||||
|
||||
it("falls back when a sensor disappears", () => {
|
||||
expect(selectTemperatureSensor(sensors, "missing")).toBeNull();
|
||||
});
|
||||
|
||||
it("scopes the preference to a host", () => {
|
||||
expect(temperaturePreferenceKey(42)).toBe(
|
||||
"termix-host-metrics:42:temperature-sensor",
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user