fix: complete display and channel group management
This commit is contained in:
@@ -487,6 +487,56 @@ describe("Signage dashboard", () => {
|
||||
expect(container.textContent).toContain("SLIDE_DECODE_FAILED");
|
||||
});
|
||||
|
||||
it("explains display registration and deletes a channel group only after confirmation", async () => {
|
||||
const secondGroup = {
|
||||
...GROUP,
|
||||
channels: [{ id: "chan-2", isDefault: true, key: "default", name: "Default" }],
|
||||
id: "group-2",
|
||||
name: "Foyer",
|
||||
playback: { ...GROUP.playback, groupId: "group-2" },
|
||||
};
|
||||
let currentGroups = [GROUP, secondGroup];
|
||||
const deleted: string[] = [];
|
||||
const host = createFakeHost({
|
||||
permissions: ["signage.view", "signage.displays.manage"],
|
||||
routes: [
|
||||
{ method: "GET", path: "settings", respond: () => jsonResponse(FAKE_SETTINGS) },
|
||||
{
|
||||
method: "GET",
|
||||
path: "channel-groups",
|
||||
respond: () => jsonResponse({ groups: currentGroups }),
|
||||
},
|
||||
{ method: "GET", path: "timelines", respond: () => jsonResponse({ timelines: [] }) },
|
||||
{ method: "GET", path: "playback/group-1", respond: () => jsonResponse(PLAYBACK_DETAIL) },
|
||||
{ method: "GET", path: "viewers", respond: () => jsonResponse({ viewers: [] }) },
|
||||
{
|
||||
method: "DELETE",
|
||||
path: "channel-groups/group-1",
|
||||
respond: ({ path }) => {
|
||||
deleted.push(path);
|
||||
currentGroups = [secondGroup];
|
||||
return new Response(null, { status: 204 });
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
await render(<SignageDashboard context={host.context} />);
|
||||
await click(
|
||||
[...container.querySelectorAll("[role='tab']")].find(
|
||||
(candidate) => candidate.textContent === "Displays",
|
||||
),
|
||||
);
|
||||
|
||||
expect(container.textContent).toContain("/display/signage");
|
||||
expect(container.textContent).toContain("Provider audience key");
|
||||
await click(buttonNamed("Delete group"));
|
||||
expect(deleted).toEqual([]);
|
||||
expect(container.textContent).toContain("Displays assigned here will move");
|
||||
await click(buttonNamed("Confirm delete"));
|
||||
expect(deleted).toEqual(["channel-groups/group-1"]);
|
||||
});
|
||||
|
||||
it("uploads one request per file and reports each one's own outcome", async () => {
|
||||
const uploaded: string[] = [];
|
||||
const host = createFakeHost({
|
||||
|
||||
Reference in New Issue
Block a user