<a href={LinkMappingUtility.getMappedWebUiLink('/#/dashboard')}
data-id="0"
className="nav-menu-item"
autoFocus="true">
{menuItem({ linkTitle: translate('sbDashboard', currentLanguage), icon: 'swn-home-icon' })}
this is the anchor tag inside that i have menu item text and i want the text in enzyme
My Code is :
test('all menu items display the correct text', () => {
const allMenuItemText = [
{ linkTitle: 'Dashboard', icon: 'swn-home-icon' },
{ linkTitle: 'Alerts', icon: 'swn-alerts-icon' },
{ linkTitle: 'Contact Management', icon: 'swn-home-icon'},
{ linkTitle: 'Reporting', icon: 'swn-home-icon' },
{ linkTitle: 'Solutions', icon: 'swn-home-icon' },
{ linkTitle: 'Integrations', icon: 'swn-home-icon' },
{ linkTitle: 'Account Settings', icon: 'swn-home-icon'},
{ linkTitle: 'Support & Training', icon: 'swn-home-icon' }
];
wrapper.find('.nav-menu-item').forEach((node, index) => {
expect(node.text()).toEqual(allMenuItemText[index].linkTitle);
})
output : here i am getting the empty string in return