Skip to content

Commit

Permalink
Revise test suit
Browse files Browse the repository at this point in the history
Signed-off-by: Willie Hung <[email protected]>
  • Loading branch information
willie-hung committed Nov 5, 2023
1 parent 0378e8b commit e69ff56
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/core/public/chrome/ui/header/nav_link.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

0 comments on commit e69ff56

Please sign in to comment.