Skip to content

Commit 4120d2e

Browse files
committed
chore: keep the original order
1 parent 1751ae4 commit 4120d2e

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

packages/components/button/__tests__/button.test.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,26 @@ describe("Button", () => {
2525
expect(ref.current).not.toBeNull();
2626
});
2727

28-
it("should trigger onClick function", async () => {
29-
const onClick = jest.fn();
30-
const {getByRole} = render(<Button disableRipple onClick={onClick} />);
28+
it("should trigger onPress function", async () => {
29+
const onPress = jest.fn();
30+
const {getByRole} = render(<Button disableRipple onPress={onPress} />);
3131

3232
const button = getByRole("button");
3333

3434
await user.click(button);
3535

36-
expect(onClick).toHaveBeenCalled();
36+
expect(onPress).toHaveBeenCalled();
3737
});
3838

39-
it("should trigger onPress function", async () => {
40-
const onPress = jest.fn();
41-
const {getByRole} = render(<Button disableRipple onPress={onPress} />);
39+
it("should trigger onClick function", async () => {
40+
const onClick = jest.fn();
41+
const {getByRole} = render(<Button disableRipple onClick={onClick} />);
4242

4343
const button = getByRole("button");
4444

4545
await user.click(button);
4646

47-
expect(onPress).toHaveBeenCalled();
47+
expect(onClick).toHaveBeenCalled();
4848
});
4949

5050
it("should ignore events when disabled", async () => {

packages/components/link/__tests__/link.test.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,26 @@ describe("Link", () => {
4040
expect(container.querySelector("svg")).not.toBeNull();
4141
});
4242

43-
it("should trigger onClick function", async () => {
44-
const onClick = jest.fn();
45-
const {getByRole} = render(<Link onClick={onClick} />);
43+
it("should trigger onPress function", async () => {
44+
const onPress = jest.fn();
45+
const {getByRole} = render(<Link onPress={onPress} />);
4646

4747
const link = getByRole("link");
4848

4949
await user.click(link);
5050

51-
expect(onClick).toHaveBeenCalled();
51+
expect(onPress).toHaveBeenCalled();
5252
});
5353

54-
it("should trigger onPress function", async () => {
55-
const onPress = jest.fn();
56-
const {getByRole} = render(<Link onPress={onPress} />);
54+
it("should trigger onClick function", async () => {
55+
const onClick = jest.fn();
56+
const {getByRole} = render(<Link onClick={onClick} />);
5757

5858
const link = getByRole("link");
5959

6060
await user.click(link);
6161

62-
expect(onPress).toHaveBeenCalled();
62+
expect(onClick).toHaveBeenCalled();
6363
});
6464

6565
it('should have target="_blank" and rel="noopener noreferrer" when "isExternal" is true', () => {

0 commit comments

Comments
 (0)