Skip to content

Commit

Permalink
Breadcrumbs updates based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
GomezIvann committed Mar 21, 2024
1 parent 26f3851 commit 7f47f8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions lib/src/breadcrumbs/Breadcrumbs.stories.tsx
Expand Up @@ -178,10 +178,8 @@ const Breadcrumbs = () => (
</ExampleContainer>
</ExampleContainer>
<Title title="Collapsed variant with dropdown menu opened" theme="light" level={3} />
<ExampleContainer>
<DxcContainer height="200px">
<DxcBreadcrumbs items={items} />
</DxcContainer>
<ExampleContainer expanded>
<DxcBreadcrumbs items={items} />
</ExampleContainer>
</>
);
Expand Down
8 changes: 4 additions & 4 deletions lib/src/breadcrumbs/Breadcrumbs.test.tsx
Expand Up @@ -69,13 +69,13 @@ describe("Breadcrumbs component tests", () => {
<DxcBreadcrumbs
onItemClick={onItemClick}
items={[
{ label: "Home", href: "/" },
{ label: "Preferences", href: "/" },
{ label: "Home", href: "/home" },
{ label: "Preferences", href: "/preferences" },
]}
/>
);
userEvent.click(getByText("Home"));
expect(onItemClick).toHaveBeenCalled();
expect(onItemClick).toHaveBeenCalledWith("/home");
});
test("The onClick prop from an item is properly called (collapsed)", async () => {
const onItemClick = jest.fn();
Expand All @@ -92,6 +92,6 @@ describe("Breadcrumbs component tests", () => {
);
await userEvent.click(getByRole("button"));
await userEvent.click(getByText("Preferences"));
expect(onItemClick).toHaveBeenCalled();
expect(onItemClick).toHaveBeenCalledWith("/");
});
});

0 comments on commit 7f47f8f

Please sign in to comment.