From e69ff5631137d88bf1e4d2d525899863fd148448 Mon Sep 17 00:00:00 2001 From: Willie Hung Date: Sun, 5 Nov 2023 13:35:06 -0600 Subject: [PATCH] Revise test suit Signed-off-by: Willie Hung --- .../public/chrome/ui/header/nav_link.test.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/core/public/chrome/ui/header/nav_link.test.tsx b/src/core/public/chrome/ui/header/nav_link.test.tsx index a6e3a327756b..c0fc448bf6fd 100644 --- a/src/core/public/chrome/ui/header/nav_link.test.tsx +++ b/src/core/public/chrome/ui/header/nav_link.test.tsx @@ -121,12 +121,14 @@ describe('createEuiListItem', () => { it('creates a list item with the correct properties', () => { const listItem = createEuiListItem(mockProps); - expect(listItem.label).toBe(mockProps.link.tooltip); - expect(listItem.href).toBe(mockProps.link.href); - expect(listItem['data-test-subj']).toBe(mockProps.dataTestSubj); - expect(listItem.onClick).toBeDefined(); - expect(listItem.isActive).toBe(isActiveNavLink(mockProps.appId, mockProps.link.id)); - expect(listItem.isDisabled).toBe(mockProps.link.disabled); - expect(listItem.iconType).toBe(mockProps.link.euiIconType); + expect(listItem).toHaveProperty('label', mockProps.link.tooltip); + expect(listItem).toHaveProperty('href', mockProps.link.href); + expect(listItem).toHaveProperty('data-test-subj', mockProps.dataTestSubj); + expect(listItem).toHaveProperty('onClick'); + expect(listItem).toHaveProperty( + 'isActive', + isActiveNavLink(mockProps.appId, mockProps.link.id) + ); + expect(listItem).toHaveProperty('isDisabled', mockProps.link.disabled); }); });