Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
vicky-comeau committed Nov 7, 2024
1 parent 6f5403b commit d859831
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions packages/components/src/tag/tests/jest/TagGroup.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { render, screen } from "@hopper-ui/test-utils";
import { createRef } from "react";

import { Tag, TagGroup, TagGroupContext, type TagListProps } from "../../src/index.ts";

type ExtendedTagListProps<T extends object> = TagListProps<T> & {
"data-testid"?: string;
};
import { Tag, TagGroup, TagGroupContext } from "../../src/index.ts";

describe("Tag", () => {
it("should render with default class", () => {
Expand Down Expand Up @@ -41,18 +37,15 @@ describe("Tag", () => {
render(
<TagGroupContext.Provider value={{ slots: { test: { "aria-label": "test" } } }}>
<TagGroup slot="test"
data-testid="tag-group"
tagListProps={
{ "data-testid": "tag-list" } as ExtendedTagListProps<object>
}
data-testid="tag-group"
>
<Tag id="option1">option 1</Tag>
</TagGroup>
</TagGroupContext.Provider>
);

const element = screen.getByTestId("tag-group");
const tagList = screen.getByTestId("tag-list");
const tagList = screen.getByRole("grid");

expect(element).toHaveAttribute("slot", "test");
expect(tagList).toHaveAttribute("aria-label", "test");
Expand Down

0 comments on commit d859831

Please sign in to comment.