fix: ansi terminal tests

This commit is contained in:
Dallin Romney 2025-11-18 09:49:11 -08:00
parent 9bb396b0f5
commit 7bcfd1a681

View file

@ -178,9 +178,14 @@ describe("UnifiedTerminalCommand", () => {
expect(container.textContent).toMatch(/Bold text/);
expect(container.textContent).toMatch(/Underlined text/);
// Verify ANSI processing created styled spans
const styledSpans = container.querySelectorAll('span[class*="sc-esYiGF"]');
expect(styledSpans.length).toBeGreaterThan(0);
// Verify ANSI processing created span elements within the code block
// The AnsiRenderer creates spans for each ANSI segment
const codeElement = container.querySelector("code");
expect(codeElement).toBeInTheDocument();
// Count all spans inside the code element (ANSI creates multiple spans)
const spans = codeElement?.querySelectorAll("span");
expect(spans?.length).toBeGreaterThan(0);
});
test("handles links in output", async () => {