From d4f3f2588a810d7d08e0bb9cd121dc3ba5f6f1b2 Mon Sep 17 00:00:00 2001 From: dvd233 <111864431+dvd233@users.noreply.github.com> Date: Sat, 10 Oct 2026 18:56:14 +0800 Subject: [PATCH] test: replace removed Jest matcher aliases --- tests/Tags.test.tsx | 2 +- tests/shared/allowClearTest.tsx | 4 ++-- tests/shared/hoverTest.tsx | 4 ++-- tests/shared/removeSelectedTest.tsx | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/Tags.test.tsx b/tests/Tags.test.tsx index 5a4ad6e6..28e033bd 100644 --- a/tests/Tags.test.tsx +++ b/tests/Tags.test.tsx @@ -730,7 +730,7 @@ describe('Select.Tags', () => { fireEvent.change(input, { target: { value: 'test' }, }); - expect(onChange).not.toBeCalled(); + expect(onChange).not.toHaveBeenCalled(); }); // https://github.com/ant-design/ant-design/issues/56587 diff --git a/tests/shared/allowClearTest.tsx b/tests/shared/allowClearTest.tsx index 8974d7f4..33ee90f3 100644 --- a/tests/shared/allowClearTest.tsx +++ b/tests/shared/allowClearTest.tsx @@ -59,7 +59,7 @@ export default function allowClearTest(mode: any, value: any) { } else { expect(onChange).toHaveBeenCalledWith(undefined, undefined); } - expect(onDeselect).not.toBeCalled(); + expect(onDeselect).not.toHaveBeenCalled(); expect(container.querySelector('input').value).toEqual(''); expect(onClear).toHaveBeenCalled(); }); @@ -100,7 +100,7 @@ export default function allowClearTest(mode: any, value: any) { } else { expect(onChange).toHaveBeenCalledWith(undefined, undefined); } - expect(onDeselect).not.toBeCalled(); + expect(onDeselect).not.toHaveBeenCalled(); expect(container.querySelector('input').value).toEqual(''); expect(onClear).toHaveBeenCalled(); }); diff --git a/tests/shared/hoverTest.tsx b/tests/shared/hoverTest.tsx index 0c0f39ae..9f38daf9 100644 --- a/tests/shared/hoverTest.tsx +++ b/tests/shared/hoverTest.tsx @@ -14,8 +14,8 @@ export default function hoverTest(mode: any) { ); fireEvent.mouseEnter(container.querySelector('.rc-select')); - expect(onMouseEnter).toBeCalled(); + expect(onMouseEnter).toHaveBeenCalled(); fireEvent.mouseLeave(container.querySelector('.rc-select')); - expect(onMouseLeave).toBeCalled(); + expect(onMouseLeave).toHaveBeenCalled(); }); } diff --git a/tests/shared/removeSelectedTest.tsx b/tests/shared/removeSelectedTest.tsx index 7bb28ed7..bed58818 100644 --- a/tests/shared/removeSelectedTest.tsx +++ b/tests/shared/removeSelectedTest.tsx @@ -19,11 +19,11 @@ export default function removeSelectedTest(mode: any) { ); removeSelection(container); - expect(handleDeselect).toBeCalledWith( + expect(handleDeselect).toHaveBeenCalledWith( '1', expect.objectContaining({ value: '1', testprop: 'deselect' }), ); - expect(handleChange).toBeCalledWith(['2'], expect.anything()); + expect(handleChange).toHaveBeenCalledWith(['2'], expect.anything()); }); it('noop if select is disabled', () => {