forked from nightscout/cgm-remote-monitor
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpluginbase.test.js
More file actions
33 lines (27 loc) · 901 Bytes
/
pluginbase.test.js
File metadata and controls
33 lines (27 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* @vitest-environment jsdom
*/
import { describe, expect, it } from "vitest";
import setupBrowser from "./setup/browser";
describe("pluginbase", () => {
it("updates major pill text correctly", async () => {
await setupBrowser();
const bgStatusBefore = document.querySelector(".bgStatus");
const minorPillsBefore = document.querySelector(".minorPills");
window.Nightscout.client.ctx.pluginBase.updatePillText(
{
name: "fake",
label: "Insulin-on-Board",
pluginType: "pill-major",
},
{
value: "123",
label: "TEST",
info: [{ label: "Label", value: "Value" }],
}
);
expect(document.querySelector(".majorPills")).toHaveTextContent("TEST123");
expect(document.querySelector(".minorPills")).toBe(minorPillsBefore);
expect(document.querySelector(".bgStatus")).toBe(bgStatusBefore);
});
});