Skip to content

Commit

Permalink
fix: Remove wheelchair icon from non-accessible stop pages (#2244)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshlarson authored Dec 3, 2024
1 parent 5ab1881 commit 929128f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,14 @@ describe("AccessibilityIcon", () => {
);
expect(screen.getByTestId("empty")).not.toBeEmptyDOMElement();
});

it("should not return an icon for an accessible stop", () => {
const stop = { accessibility: ["escalator_up"] };
render(
<div data-testid="empty">
<AccessibilityIcon stop={stop as Stop} />
</div>
);
expect(screen.getByTestId("empty")).toBeEmptyDOMElement();
});
});
2 changes: 1 addition & 1 deletion assets/ts/stop/components/icons/AccessibilityIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const AccessibilityIcon = ({
}: {
stop: Stop;
}): ReactElement<HTMLElement> | null => {
if (stop.accessibility.length === 0) return null;
if (!stop.accessibility.includes("accessible")) return null;
return (
<div className="m-stop-page__access-icon">
<span className="m-stop-page__icon">
Expand Down

0 comments on commit 929128f

Please sign in to comment.