Skip to content

Commit

Permalink
Update MegaMenu.spec.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Oct 19, 2022
1 parent ba3ac17 commit e42c9e7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/megamenu/MegaMenu.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,17 @@ describe('MegaMenu.vue', () => {
it('should select item', async () => {
const firstItem = wrapper.findAll('li.p-menuitem')[0];

await firstItem.trigger('click');
await firstItem.find('.p-menuitem-content').trigger('click');

expect(firstItem.classes()).toContain('p-menuitem-active');
});

it('should deselect item', async () => {
const firstItem = wrapper.findAll('li.p-menuitem')[0];
const firstItemContent = firstItem.find('.p-menuitem-content');

await firstItem.trigger('click');
await firstItem.trigger('click');
await firstItemContent.trigger('click');
await firstItemContent.trigger('click');

expect(firstItem.classes()).not.toContain('p-menuitem-active');
});
Expand Down

0 comments on commit e42c9e7

Please sign in to comment.