From 421f8a69a24a14c6a65eb416f873daa60333d434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 27 Sep 2022 16:28:23 +0200 Subject: [PATCH] Enhance tests of 'AvatarMenu' --- .../components/AvatarMenu/AvatarMenu.spec.js | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/webapp/components/AvatarMenu/AvatarMenu.spec.js b/webapp/components/AvatarMenu/AvatarMenu.spec.js index 77de68de4..15f536ee7 100644 --- a/webapp/components/AvatarMenu/AvatarMenu.spec.js +++ b/webapp/components/AvatarMenu/AvatarMenu.spec.js @@ -90,6 +90,13 @@ describe('AvatarMenu.vue', () => { expect(profileLink.exists()).toBe(true) }) + it('displays a link to "My groups"', () => { + const profileLink = wrapper + .findAll('.ds-menu-item span') + .at(wrapper.vm.routes.findIndex((route) => route.path === '/my-groups')) + expect(profileLink.exists()).toBe(true) + }) + it('displays a link to the notifications page', () => { const notificationsLink = wrapper .findAll('.ds-menu-item span') @@ -103,6 +110,11 @@ describe('AvatarMenu.vue', () => { .at(wrapper.vm.routes.findIndex((route) => route.path === '/settings')) expect(settingsLink.exists()).toBe(true) }) + + it('displays a total of 4 links', () => { + const allLinks = wrapper.findAll('.ds-menu-item') + expect(allLinks).toHaveLength(4) + }) }) describe('role moderator', () => { @@ -125,9 +137,9 @@ describe('AvatarMenu.vue', () => { expect(moderationLink.exists()).toBe(true) }) - it('displays a total of 4 links', () => { + it('displays a total of 5 links', () => { const allLinks = wrapper.findAll('.ds-menu-item') - expect(allLinks).toHaveLength(4) + expect(allLinks).toHaveLength(5) }) }) @@ -151,9 +163,9 @@ describe('AvatarMenu.vue', () => { expect(adminLink.exists()).toBe(true) }) - it('displays a total of 5 links', () => { + it('displays a total of 6 links', () => { const allLinks = wrapper.findAll('.ds-menu-item') - expect(allLinks).toHaveLength(5) + expect(allLinks).toHaveLength(6) }) }) })