mirror of
https://github.com/MeshCore-Beacon/beacon-web.git
synced 2026-10-22 22:21:24 +00:00
feat: observer monitoring, retained evidence and channel scopes (#75-#99)
Lands the stacked web PRs #75, #79, #80, #81, #83, #85, #87, #89, #92, #95 and #99 in one squash. Server counterparts #166-#176 are merged. Remaining review items follow in a fix PR.
This commit is contained in:
1 parent
17f48fb932
commit
d259be512e
93 files changed
+2900
-810
No files matched your search
@@ -34,18 +34,18 @@ const detail = {
|
||||
} as unknown as PacketDetail;
|
||||
|
||||
describe("PacketPathMapModal", () => {
|
||||
it("lists All paths plus a row per observer and starts on All", () => {
|
||||
it("lists All paths plus a row per observer and starts on All", async () => {
|
||||
render(<PacketPathMapModal detail={detail} onClose={() => {}} />);
|
||||
expect(screen.getByText("All paths")).toBeInTheDocument();
|
||||
expect(screen.getByText("Alpha")).toBeInTheDocument();
|
||||
expect(screen.getByText("Bravo")).toBeInTheDocument();
|
||||
expect(screen.getByTestId("mini-map")).toHaveTextContent("all");
|
||||
expect(await screen.findByTestId("mini-map")).toHaveTextContent("all");
|
||||
});
|
||||
|
||||
it("isolates a path when its row is clicked", () => {
|
||||
it("isolates a path when its row is clicked", async () => {
|
||||
render(<PacketPathMapModal detail={detail} onClose={() => {}} />);
|
||||
fireEvent.click(screen.getByText("Bravo"));
|
||||
expect(screen.getByTestId("mini-map")).toHaveTextContent("obs-bravo");
|
||||
expect(await screen.findByTestId("mini-map")).toHaveTextContent("obs-bravo");
|
||||
});
|
||||
|
||||
it("shows each observer's propagation", () => {
|
||||
@@ -61,14 +61,18 @@ describe("PacketPathMapModal", () => {
|
||||
expect(onClose).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
it("pre-selects the observer from initialSelectedKey", () => {
|
||||
it("pre-selects the observer from initialSelectedKey", async () => {
|
||||
render(<PacketPathMapModal detail={detail} onClose={() => {}} initialSelectedKey="obs-bravo" />);
|
||||
expect(screen.getByTestId("mini-map")).toHaveTextContent("obs-bravo");
|
||||
expect(await screen.findByTestId("mini-map")).toHaveTextContent("obs-bravo");
|
||||
});
|
||||
|
||||
it("falls back to All when initialSelectedKey isn't a known path", () => {
|
||||
it("does not silently substitute all paths for an unavailable selected path", async () => {
|
||||
render(<PacketPathMapModal detail={detail} onClose={() => {}} initialSelectedKey="nope" />);
|
||||
expect(screen.getByTestId("mini-map")).toHaveTextContent("all");
|
||||
expect(await screen.findByTestId("mini-map")).toHaveTextContent("nope");
|
||||
expect(screen.getByRole("status")).toHaveTextContent("selected path cannot be mapped");
|
||||
fireEvent.click(screen.getByText("All paths"));
|
||||
expect(await screen.findByTestId("mini-map")).toHaveTextContent("all");
|
||||
expect(screen.queryByRole("status")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders a copy-link button", () => {
|
||||
|
||||
Reference in new issue
Block a user