Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions web/src/components/core/IssuesDrawer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ describe("IssuesDrawer", () => {
expect(usersLink).toHaveAttribute("href", "/users");
within(usersIssues).getByText("Users Fake Issue");

// onClose should be called when user clicks on a section too for ensuring
// drawer gets closed even when navigation is not needed.
await user.click(usersLink);
expect(onCloseFn).toHaveBeenCalled();

const closeButton = screen.getByRole("button", { name: "Close" });
await user.click(closeButton);
expect(onCloseFn).toHaveBeenCalled();
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/core/IssuesDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const IssuesDrawer = forwardRef(({ onClose }: { onClose: () => void }, ref) => {
<section key={idx} aria-labelledby={ariaLabelId}>
<Stack hasGutter>
<h4 id={ariaLabelId}>
<Link variant="link" isInline to={`/${scope}`}>
<Link variant="link" isInline onClick={onClose} to={`/${scope}`}>
{scopeHeaders[scope]}
</Link>
</h4>
Expand Down