diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.spec.js b/frontend/src/views/Layout/DashboardLayout_gdd.spec.js index 5cf1f2cb0..3aa5cb124 100644 --- a/frontend/src/views/Layout/DashboardLayout_gdd.spec.js +++ b/frontend/src/views/Layout/DashboardLayout_gdd.spec.js @@ -97,15 +97,50 @@ describe('DashboardLayoutGdd', () => { expect(navbar.findAll('ul > li').at(1).text()).toEqual('transactions') }) - it('has second item "transactions" linked to transactions in navbar', async () => { - console.log(wrapper.findComponent(RouterLinkStub).props().to) + // to do: get this working! + it.skip('has second item "transactions" linked to transactions in navbar', async () => { navbar.findAll('ul > li > a').at(1).trigger('click') - await wrapper.vm.$nextTick() await flushPromises() await jest.runAllTimers() - console.log(wrapper.findComponent(RouterLinkStub).props().to) + await flushPromises() expect(wrapper.findComponent(RouterLinkStub).props().to).toBe('/transactions') }) + + it('has third item "My profile" in navbar', () => { + expect(navbar.findAll('ul > li').at(2).text()).toEqual('site.navbar.my-profil') + }) + + it.skip('has third item "My profile" linked to profile in navbar', async () => { + navbar.findAll('ul > li > a').at(2).trigger('click') + await flushPromises() + await jest.runAllTimers() + await flushPromises() + expect(wrapper.findComponent(RouterLinkStub).props().to).toBe('/profile') + }) + + it('has fourth item "Settigs" in navbar', () => { + expect(navbar.findAll('ul > li').at(3).text()).toEqual('site.navbar.settings') + }) + + it.skip('has fourth item "Settings" linked to profileedit in navbar', async () => { + navbar.findAll('ul > li > a').at(3).trigger('click') + await flushPromises() + await jest.runAllTimers() + await flushPromises() + expect(wrapper.findComponent(RouterLinkStub).props().to).toBe('/profileedit') + }) + + it('has fifth item "Activity" in navbar', () => { + expect(navbar.findAll('ul > li').at(4).text()).toEqual('site.navbar.activity') + }) + + it.skip('has fourth item "Activity" linked to activity in navbar', async () => { + navbar.findAll('ul > li > a').at(4).trigger('click') + await flushPromises() + await jest.runAllTimers() + await flushPromises() + expect(wrapper.findComponent(RouterLinkStub).props().to).toBe('/activity') + }) }) }) })