From d46f430f9775b2b9151c88393484e464e70a42a8 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Fri, 15 Oct 2021 11:10:54 +0200 Subject: [PATCH 1/2] fix: Test Default Publisher ID in Sidebar Menu --- .../components/SidebarPlugin/SideBar.spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/frontend/src/components/SidebarPlugin/SideBar.spec.js b/frontend/src/components/SidebarPlugin/SideBar.spec.js index e42369e50..1f9527c92 100644 --- a/frontend/src/components/SidebarPlugin/SideBar.spec.js +++ b/frontend/src/components/SidebarPlugin/SideBar.spec.js @@ -124,6 +124,23 @@ describe('SideBar', () => { expect(wrapper.findAll('li').at(0).text()).not.toContain('!') }) }) + + describe("member's area with default publisher ID", () => { + beforeEach(() => { + mocks.$store.state.publisherId = null + mocks.$store.state.hasElopage = true + }) + + it('links to the elopage member area with default publisher ID', () => { + expect(wrapper.findAll('li').at(0).find('a').attributes('href')).toBe( + 'https://elopage.com/s/gradido/sign_in?locale=de', + ) + }) + + it('has no badge', () => { + expect(wrapper.findAll('li').at(0).text()).not.toContain('!') + }) + }) }) describe('logout', () => { From f18bf9e4d756aa463c5fbe16124d6995f82c722b Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Fri, 15 Oct 2021 11:21:21 +0200 Subject: [PATCH 2/2] test the link with no elopage and default pid --- frontend/src/components/SidebarPlugin/SideBar.spec.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/SidebarPlugin/SideBar.spec.js b/frontend/src/components/SidebarPlugin/SideBar.spec.js index 1f9527c92..8204eb604 100644 --- a/frontend/src/components/SidebarPlugin/SideBar.spec.js +++ b/frontend/src/components/SidebarPlugin/SideBar.spec.js @@ -125,20 +125,20 @@ describe('SideBar', () => { }) }) - describe("member's area with default publisher ID", () => { + describe("member's area with default publisher ID and no elopage", () => { beforeEach(() => { mocks.$store.state.publisherId = null - mocks.$store.state.hasElopage = true + mocks.$store.state.hasElopage = false }) it('links to the elopage member area with default publisher ID', () => { expect(wrapper.findAll('li').at(0).find('a').attributes('href')).toBe( - 'https://elopage.com/s/gradido/sign_in?locale=de', + 'https://elopage.com/s/gradido/basic-de/payment?locale=de&prid=111&pid=2896&firstName=test&lastName=example&email=test@example.org', ) }) - it('has no badge', () => { - expect(wrapper.findAll('li').at(0).text()).not.toContain('!') + it('has a badge', () => { + expect(wrapper.findAll('li').at(0).text()).toContain('!') }) }) })