MAESTRO: improve responsive wrapping and layout

This commit is contained in:
Mariusz Banach
2026-02-18 04:53:02 +01:00
parent cfb945e1c4
commit af339e784e
10 changed files with 70 additions and 28 deletions

View File

@@ -88,4 +88,16 @@ describe("HopChainVisualisation", () => {
expect(connectors.length).toBe(hopChain.length - 1);
});
it("adds wrapping classes for long hostnames and IPs", () => {
const { container } = render(<HopChainVisualisation hopChain={hopChain} />);
const firstHop = getByTestId(container, "hop-chain-node-0");
const spanNodes = Array.from(firstHop.querySelectorAll("span"));
const hostnameNode = spanNodes.find((node) => node.textContent === "mail.sender.example");
const ipNode = spanNodes.find((node) => node.textContent === "192.0.2.10");
expect(hostnameNode?.className ?? "").toContain("break-words");
expect(ipNode?.className ?? "").toContain("break-all");
});
});

View File

@@ -127,4 +127,25 @@ describe("TestResultCard", () => {
const errorIndicator = getByTestId(container, `test-result-error-${result.testId}`);
expect(errorIndicator.textContent ?? "").toMatch(/SpamAssassin database timeout/);
});
it("adds wrapping classes for long header values", () => {
const result = buildResult({
testId: 505,
headerValue: "X".repeat(200),
});
const { container } = render(<TestResultCard result={result} />);
const details = container.querySelector(`#test-result-details-${result.testId}`);
if (!details) {
throw new Error("Expected test details container to be rendered.");
}
const headerValue = details.querySelector("span.font-mono");
if (!headerValue) {
throw new Error("Expected header value to be rendered.");
}
expect(headerValue.className).toContain("break-words");
expect(headerValue.className).toContain("whitespace-pre-wrap");
});
});