Hide unused helper marks on selection cards and modal section labels until tooltip behavior ships.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -119,4 +119,10 @@ describe("ApplicableScopeField behavior", () => {
|
||||
screen.queryByRole("textbox", { name: /Add Applicable Scope/i }),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("does not render a section help icon", () => {
|
||||
renderWithProviders(<ApplicableScopeField {...baseProps} />);
|
||||
|
||||
expect(screen.queryByAltText("Help")).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -77,6 +77,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
|
||||
);
|
||||
|
||||
const dialog = await screen.findByRole("dialog");
|
||||
expect(within(dialog).queryByAltText("Help")).not.toBeInTheDocument();
|
||||
const textboxes = within(dialog).getAllByRole("textbox");
|
||||
expect(textboxes.length).toBe(3);
|
||||
const corePrincipleField = textboxes[0] as HTMLTextAreaElement;
|
||||
|
||||
@@ -45,6 +45,7 @@ describe("CustomMethodCardFieldBlocksSummary", () => {
|
||||
}),
|
||||
).toBeInTheDocument();
|
||||
expect(screen.queryByRole("button", { name: "Upload" })).not.toBeInTheDocument();
|
||||
expect(screen.queryByAltText("Help")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("after remove, parent can pass cleared blocks and Upload shows again", () => {
|
||||
|
||||
@@ -85,4 +85,29 @@ describe("ModalTextAreaField behavior", () => {
|
||||
|
||||
expect(screen.getByRole("textbox", { name: /Notes/i })).toBeDisabled();
|
||||
});
|
||||
|
||||
it("does not render a section help icon by default", () => {
|
||||
renderWithProviders(
|
||||
<ModalTextAreaField
|
||||
label="Core principle"
|
||||
value=""
|
||||
onChange={() => {}}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(screen.queryByAltText("Help")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders a section help icon when helpIcon is true", () => {
|
||||
renderWithProviders(
|
||||
<ModalTextAreaField
|
||||
label="Core principle"
|
||||
helpIcon
|
||||
value=""
|
||||
onChange={() => {}}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(screen.getByAltText("Help")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -65,6 +65,21 @@ describe("CardStack Component", () => {
|
||||
expect(screen.getAllByText("Option C").length).toBeGreaterThanOrEqual(1);
|
||||
});
|
||||
|
||||
test("hides helper icons on compact, expanded, and single-stack cards", () => {
|
||||
const { unmount } = render(
|
||||
<CardStack cards={SAMPLE_CARDS} expanded={false} />,
|
||||
);
|
||||
expect(screen.queryByText("?")).not.toBeInTheDocument();
|
||||
unmount();
|
||||
|
||||
const expanded = render(<CardStack cards={SAMPLE_CARDS} expanded={true} />);
|
||||
expect(screen.queryByText("?")).not.toBeInTheDocument();
|
||||
expanded.unmount();
|
||||
|
||||
render(<CardStack cards={SAMPLE_CARDS} layout="singleStack" />);
|
||||
expect(screen.queryByText("?")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("expanded tiles use the compact 142px CardSelection height", () => {
|
||||
render(<CardStack cards={SAMPLE_CARDS} expanded={true} />);
|
||||
|
||||
|
||||
@@ -54,6 +54,24 @@ describe("Selection Component", () => {
|
||||
expect(card).toHaveClass("flex-row");
|
||||
});
|
||||
|
||||
it("does not render a helper icon by default", () => {
|
||||
render(<Selection {...defaultProps} orientation="vertical" />);
|
||||
|
||||
expect(screen.queryByText("?")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders a helper icon when showInfoIcon is true", () => {
|
||||
render(
|
||||
<Selection
|
||||
{...defaultProps}
|
||||
orientation="vertical"
|
||||
showInfoIcon={true}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(screen.getByText("?")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("handles click events", () => {
|
||||
const handleClick = vi.fn();
|
||||
render(<Selection {...defaultProps} onClick={handleClick} />);
|
||||
|
||||
Reference in New Issue
Block a user