Skip to content

Commit 46f0253

Browse files
carderneTrigger.dev RepoOps
authored andcommitted
test(webapp): remove misleading source, presentation and trivial UI tests
Mono-RevId: 70fd3fbaaaff57860b275a5503c91710ad13a92b
1 parent 0f2942d commit 46f0253

28 files changed

Lines changed: 6 additions & 1414 deletions

‎apps/webapp/app/components/dashboard-agent/AgentMarkdownTable.dom.test.ts‎

Lines changed: 1 addition & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ afterEach(() => {
123123
});
124124

125125
describe("AgentMarkdownTable fullscreen", () => {
126-
it("renders the Table primitives font-mono text-xs, preserving a link inside a cell", () => {
126+
it("opens a fullscreen dialog and preserves links inside cells", () => {
127127
render();
128128

129129
const maximizeButton = container!.querySelector<HTMLButtonElement>(
@@ -140,114 +140,7 @@ describe("AgentMarkdownTable fullscreen", () => {
140140
);
141141
expect(dialog).toBeTruthy();
142142

143-
// TableHeader is the only thing that renders a sticky `thead` — proves the primitive, not a
144-
// plain `<thead>`, rendered here.
145-
const thead = dialog!.querySelector("thead");
146-
expect(thead?.className).toContain("sticky");
147-
148143
const link = dialog!.querySelector("a[href='https://example.com']");
149144
expect(link?.textContent).toBe("docs");
150-
151-
const th = dialog!.querySelector("th");
152-
const td = dialog!.querySelector("td");
153-
expect(th?.className).toContain("font-mono");
154-
expect(th?.className).toContain("text-xs");
155-
expect(td?.className).toContain("font-mono");
156-
expect(td?.className).toContain("text-xs");
157-
158-
const triggers = document.querySelectorAll('[aria-label="More actions"]');
159-
const dialogTrigger = [...triggers].find((el) => !container!.contains(el));
160-
expect(dialogTrigger).toBeTruthy();
161-
});
162-
163-
it("gives every row the same full-width bottom separator, header and body alike", () => {
164-
render();
165-
166-
act(() => {
167-
container!.querySelector<HTMLButtonElement>('[aria-label="Maximize chart"]')!.click();
168-
});
169-
const dialog = [...document.querySelectorAll("[role='dialog']")].find(
170-
(el) => !container!.contains(el)
171-
)!;
172-
173-
const rows = [...dialog.querySelectorAll("tr")];
174-
expect(rows.length).toBeGreaterThanOrEqual(3);
175-
const rowClasses = rows.map((row) => row.className);
176-
177-
// Same class list for every row (header included) — no per-row inset that would stagger
178-
// the separator line — and it spans the full row width, not inset from the first cell.
179-
expect(new Set(rowClasses).size).toBe(1);
180-
expect(rowClasses[0]).toContain("after:left-0");
181-
expect(rowClasses[0]).not.toContain("after:left-3");
182-
});
183-
184-
it("keeps a GFM right-aligned column's text-align in fullscreen", () => {
185-
container = document.createElement("div");
186-
document.body.appendChild(container);
187-
root = createRoot(container);
188-
act(() => {
189-
root!.render(
190-
createElement(
191-
OperatingSystemContextProvider,
192-
{ platform: "mac" },
193-
createElement(
194-
ShortcutsProvider,
195-
null,
196-
createElement(
197-
AgentMarkdownTable,
198-
{ node: tableNode() },
199-
createElement(
200-
AgentMarkdownTableHead,
201-
{ key: "thead" },
202-
createElement(
203-
AgentMarkdownTableRow,
204-
{ key: "tr" },
205-
createElement(AgentMarkdownTableHeaderCell, { key: "a" }, "a"),
206-
createElement(
207-
AgentMarkdownTableHeaderCell,
208-
{ key: "b", style: { textAlign: "right" } },
209-
"b"
210-
)
211-
)
212-
),
213-
createElement(
214-
AgentMarkdownTableBody,
215-
{ key: "tbody" },
216-
createElement(
217-
AgentMarkdownTableRow,
218-
{ key: "tr" },
219-
createElement(AgentMarkdownTableCell, { key: "1" }, "1"),
220-
createElement(
221-
AgentMarkdownTableCell,
222-
{ key: "2", style: { textAlign: "right" } },
223-
"2"
224-
)
225-
)
226-
)
227-
)
228-
)
229-
)
230-
);
231-
});
232-
233-
act(() => {
234-
container!.querySelector<HTMLButtonElement>('[aria-label="Maximize chart"]')!.click();
235-
});
236-
const dialog = [...document.querySelectorAll("[role='dialog']")].find(
237-
(el) => !container!.contains(el)
238-
)!;
239-
240-
// `TableCell` (td) forwards `style` straight onto the DOM node, so alignment shows up as
241-
// inline style. `TableHeaderCell` (th) has no `style` prop — it takes an `alignment` enum
242-
// that renders as a text-right/text-center/text-left class instead, so it's asserted there.
243-
const rightTd = [...dialog.querySelectorAll("td")].find((cell) => cell.textContent === "2");
244-
const leftTd = [...dialog.querySelectorAll("td")].find((cell) => cell.textContent === "1");
245-
expect((rightTd as HTMLElement).style.textAlign).toBe("right");
246-
expect((leftTd as HTMLElement).style.textAlign).not.toBe("right");
247-
248-
const rightTh = [...dialog.querySelectorAll("th")].find((cell) => cell.textContent === "b");
249-
const leftTh = [...dialog.querySelectorAll("th")].find((cell) => cell.textContent === "a");
250-
expect(rightTh?.className).toContain("text-right");
251-
expect(leftTh?.className).not.toContain("text-right");
252145
});
253146
});

‎apps/webapp/app/components/dashboard-agent/AgentMarkdownTable.render.test.ts‎

Lines changed: 0 additions & 227 deletions
This file was deleted.

‎apps/webapp/app/components/dashboard-agent/AgentText.render.test.ts‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎apps/webapp/app/components/dashboard-agent/AgentText.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import type { ResolvedUri } from "./ReportView";
1818
// doesn't reach a link rendered in the table's fullscreen dialog (portaled outside that
1919
// container). Apply the app's standard link styling directly instead, reusing the trigger://
2020
// resolution from `TriggerAwareAnchor` rather than forking it.
21-
export function AgentAnchor({ href, children }: { href?: string; children?: ReactNode }) {
21+
function AgentAnchor({ href, children }: { href?: string; children?: ReactNode }) {
2222
return (
2323
<TriggerAwareAnchor href={href} className={textLinkClassName()}>
2424
{children}

‎apps/webapp/app/components/dashboard-agent/DashboardAgentMessages.tsx‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,6 @@ export function splitActionsBlocks<T>(blocks: T[]): { content: T[]; actions: T[]
165165
};
166166
}
167167

168-
// #region chat-layout transcript
169-
// `chat-layout.test.ts` fails if a spacing utility class appears in this region.
170-
171168
function renderDashboardPart(
172169
part: UIMessage["parts"][number],
173170
i: number,
@@ -457,4 +454,3 @@ export function DashboardAgentMessages(props: DashboardAgentMessagesProps) {
457454
</ChatTranscript>
458455
);
459456
}
460-
// #endregion chat-layout transcript

0 commit comments

Comments
 (0)