test: guard ui tooling assertions

This commit is contained in:
Peter Steinberger
2026-05-11 20:24:29 +01:00
parent b6027cb40e
commit 3c9fbf7071
2 changed files with 14 additions and 9 deletions

View File

@@ -818,10 +818,13 @@ describe("scripts/lib/docker-e2e-plan", () => {
),
);
expect(plan.lanes).toHaveLength(BUNDLED_PLUGIN_INSTALL_UNINSTALL_SHARDS);
expect(plan.lanes.at(0)).toBeDefined();
expect(plan.lanes.at(23)).toBeDefined();
expect(summarizeLane(plan.lanes[0])).toEqual(bundledPluginSweepLane(0));
expect(summarizeLane(plan.lanes[23])).toEqual(bundledPluginSweepLane(23));
const firstLane = plan.lanes[0];
const lastLane = plan.lanes[23];
if (!firstLane || !lastLane) {
throw new Error("Expected bundled plugin sweep boundary lanes");
}
expect(summarizeLane(firstLane)).toEqual(bundledPluginSweepLane(0));
expect(summarizeLane(lastLane)).toEqual(bundledPluginSweepLane(23));
expect(plan.needs).toEqual({
bareImage: false,
e2eImage: true,

View File

@@ -177,12 +177,14 @@ function expectBufferedPerformanceEvent(
return candidate.payload?.[key] === expected;
});
});
expect(entry).toBeDefined();
for (const [key, expected] of Object.entries(expectedPayload)) {
expect(entry?.payload?.[key]).toBe(expected);
if (!entry) {
throw new Error(`Expected performance event ${event}`);
}
expect(entry?.payload?.durationMs).toBeTypeOf("number");
return entry?.payload;
for (const [key, expected] of Object.entries(expectedPayload)) {
expect(entry.payload?.[key]).toBe(expected);
}
expect(entry.payload?.durationMs).toBeTypeOf("number");
return entry.payload;
}
describe("refreshActiveTab", () => {