Remove error icon from ExpandableMessage component (#11964)

This commit is contained in:
Alona 2025-12-08 14:50:03 -05:00 committed by GitHub
parent 8559efa7b2
commit 9b57a0b14f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 16 deletions

View File

@ -61,7 +61,7 @@ describe("ExpandableMessage", () => {
expect(icon).toHaveClass("fill-success");
});
it("should render with error icon for failed action messages", () => {
it("should render with no icon for failed action messages", () => {
renderWithProviders(
<ExpandableMessage
id="OBSERVATION_MESSAGE$RUN"
@ -75,8 +75,7 @@ describe("ExpandableMessage", () => {
"div.flex.gap-2.items-center.justify-start",
);
expect(container).toHaveClass("border-neutral-300");
const icon = screen.getByTestId("status-icon");
expect(icon).toHaveClass("fill-danger");
expect(screen.queryByTestId("status-icon")).not.toBeInTheDocument();
});
it("should render with neutral border and no icon for action messages without success prop", () => {

View File

@ -6,7 +6,6 @@ import { I18nKey } from "#/i18n/declaration";
import ArrowDown from "#/icons/angle-down-solid.svg?react";
import ArrowUp from "#/icons/angle-up-solid.svg?react";
import CheckCircle from "#/icons/check-circle-solid.svg?react";
import XCircle from "#/icons/x-circle-solid.svg?react";
import { OpenHandsAction } from "#/types/core/actions";
import { OpenHandsObservation } from "#/types/core/observations";
import { cn } from "#/utils/utils";
@ -169,19 +168,12 @@ export function ExpandableMessage({
)}
</button>
</span>
{type === "action" && success !== undefined && (
{type === "action" && success && (
<span className="flex-shrink-0">
{success ? (
<CheckCircle
data-testid="status-icon"
className={cn(statusIconClasses, "fill-success")}
/>
) : (
<XCircle
data-testid="status-icon"
className={cn(statusIconClasses, "fill-danger")}
/>
)}
<CheckCircle
data-testid="status-icon"
className={cn(statusIconClasses, "fill-success")}
/>
</span>
)}
</div>