Skip to content

Commit e4ab0a5

Browse files
committed
test(webapp): the report block adapter keeps series and links
1 parent dbb4d34 commit e4ab0a5

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

apps/webapp/app/components/dashboard-agent/report-block-adapter.test.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,14 @@ describe("reportBlockFromToolPart", () => {
9191
expect(reportBlockFromToolPart(part({ output: { ...vm, generatedAt: undefined } }))).toBeNull();
9292
});
9393

94-
it("accepts the curated tool output, which drops links and series", () => {
95-
const { links, ...curated } = vm;
96-
const block = reportBlockFromToolPart(part({ output: { ...curated, seriesOmitted: true } }))!;
97-
expect(block.vm.links).toEqual([]);
98-
expect(block.vm.metrics[0]!.series).toBeUndefined();
94+
it("passes the tool output's series and links through", () => {
95+
const series = { points: [80, 40, 120], kind: "measured" };
96+
const links = [{ key: "queues", label: "Queues", url: "/queues" }];
97+
const block = reportBlockFromToolPart(
98+
part({ output: { ...vm, metrics: [{ ...vm.metrics[0], series }], links } })
99+
)!;
100+
expect(block.vm.metrics[0]!.series).toEqual(series);
101+
expect(block.vm.links).toEqual(links);
99102
expect(block.vm.summary.severity).toBe("crit");
100103
});
101104

0 commit comments

Comments
 (0)