Skip to content

Commit 6af2fea

Browse files
committed
test: cover deprecated menu item compat
1 parent 5efe1bc commit 6af2fea

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

docs/wip-pr-placeholder.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/Menu.spec.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,10 @@ describe('Menu', () => {
444444

445445
fireEvent.click(container.querySelector('.rc-menu-item'));
446446
const info = handleClick.mock.calls[0][0];
447+
const legacyItem = info.item as unknown as { props: { eventKey?: string } };
447448
expect(info.key).toBe('1');
448-
expect(info.item).toBeTruthy();
449+
expect(legacyItem).toBeTruthy();
450+
expect(legacyItem.props.eventKey).toBe('1');
449451

450452
expect(errorSpy).toHaveBeenCalledWith(
451453
'Warning: `info.item` is deprecated since we will move to function component that not provides React Node instance in future.',

0 commit comments

Comments
 (0)