Skip to content

Commit 7802a0d

Browse files
authored
Merge pull request #8775 from continuedev/dallin/ansi-terminal-test-fix
2 parents 6f7fd3a + 7bcfd1a commit 7802a0d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

gui/src/components/UnifiedTerminal/UnifiedTerminal.test.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,14 @@ describe("UnifiedTerminalCommand", () => {
178178
expect(container.textContent).toMatch(/Bold text/);
179179
expect(container.textContent).toMatch(/Underlined text/);
180180

181-
// Verify ANSI processing created styled spans
182-
const styledSpans = container.querySelectorAll('span[class*="sc-esYiGF"]');
183-
expect(styledSpans.length).toBeGreaterThan(0);
181+
// Verify ANSI processing created span elements within the code block
182+
// The AnsiRenderer creates spans for each ANSI segment
183+
const codeElement = container.querySelector("code");
184+
expect(codeElement).toBeInTheDocument();
185+
186+
// Count all spans inside the code element (ANSI creates multiple spans)
187+
const spans = codeElement?.querySelectorAll("span");
188+
expect(spans?.length).toBeGreaterThan(0);
184189
});
185190

186191
test("handles links in output", async () => {

0 commit comments

Comments
 (0)