Skip to content

Commit 06e1c28

Browse files
test(badge-web): refactor defaultBadgeProps initialization to beforeEach for better test isolation
1 parent 565951a commit 06e1c28

File tree

1 file changed

+8
-4
lines changed
  • packages/pluggableWidgets/badge-web/src/components/__tests__

1 file changed

+8
-4
lines changed

packages/pluggableWidgets/badge-web/src/components/__tests__/Badge.spec.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ import { createElement } from "react";
55
import { Badge, BadgeProps } from "../Badge";
66

77
describe("Badge", () => {
8-
const defaultBadgeProps: BadgeProps = {
9-
type: "badge",
10-
value: "text"
11-
};
8+
let defaultBadgeProps: BadgeProps;
9+
10+
beforeEach(() => {
11+
defaultBadgeProps = {
12+
type: "badge",
13+
value: "text"
14+
};
15+
});
1216

1317
function renderBadge(props: Partial<BadgeProps> = {}): RenderResult {
1418
return render(<Badge {...defaultBadgeProps} {...props} />);

0 commit comments

Comments
 (0)