From 7dc5bbde6ca3f37076231a384a503c735d2a1327 Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 21 May 2021 13:00:21 +0200 Subject: [PATCH] Feature Profile: Add Components --- frontend/src/routes/routes.js | 16 +- .../views/Layout/DashboardLayout_gdd.spec.js | 32 ++-- .../src/views/Layout/DashboardLayout_gdd.vue | 10 +- frontend/src/views/Layout/DashboardNavbar.vue | 4 +- .../src/views/Pages/AccountOverview.spec.js | 4 - frontend/src/views/Pages/AccountOverview.vue | 3 +- frontend/src/views/Pages/Explorer.vue | 32 ---- .../Pages/UserProfile/EditProfileForm.vue | 134 -------------- .../Pages/UserProfile/ImageUploaderAvatar.vue | 72 -------- .../src/views/Pages/UserProfile/UserCard.vue | 167 +----------------- .../UserProfile/UserCard_FormUserData.vue | 73 ++++++++ .../UserProfile/UserCard_FormUserMail.vue | 41 +++++ .../UserProfile/UserCard_FormUserPasswort.vue | 59 +++++++ .../UserProfile/UserCard_FormUsername.vue | 46 +++++ .../src/views/Pages/UserProfileActivity.vue | 71 -------- frontend/src/views/Pages/UserProfileCard.vue | 24 --- frontend/src/views/Pages/UserProfileEdit.vue | 23 --- .../src/views/Pages/UserProfileOverview.vue | 33 ++++ .../Pages/UserProfileTransactionList.vue | 6 +- 19 files changed, 275 insertions(+), 575 deletions(-) delete mode 100644 frontend/src/views/Pages/Explorer.vue delete mode 100755 frontend/src/views/Pages/UserProfile/EditProfileForm.vue delete mode 100644 frontend/src/views/Pages/UserProfile/ImageUploaderAvatar.vue create mode 100644 frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue create mode 100644 frontend/src/views/Pages/UserProfile/UserCard_FormUserMail.vue create mode 100644 frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue create mode 100644 frontend/src/views/Pages/UserProfile/UserCard_FormUsername.vue delete mode 100644 frontend/src/views/Pages/UserProfileActivity.vue delete mode 100644 frontend/src/views/Pages/UserProfileCard.vue delete mode 100644 frontend/src/views/Pages/UserProfileEdit.vue create mode 100644 frontend/src/views/Pages/UserProfileOverview.vue diff --git a/frontend/src/routes/routes.js b/frontend/src/routes/routes.js index e9bcf38c8..2ba1e6b68 100755 --- a/frontend/src/routes/routes.js +++ b/frontend/src/routes/routes.js @@ -16,25 +16,11 @@ const routes = [ }, { path: '/profile', - component: () => import('../views/Pages/UserProfileCard.vue'), + component: () => import('../views/Pages/UserProfileOverview.vue'), meta: { requiresAuth: true, }, }, - // { - // path: '/profileedit', - // component: () => import('../views/Pages/UserProfileEdit.vue'), - // meta: { - // requiresAuth: true, - // }, - // }, - // { - // path: '/activity', - // component: () => import('../views/Pages/UserProfileActivity.vue'), - // meta: { - // requiresAuth: true, - // }, - // }, { path: '/transactions', component: () => import('../views/Pages/UserProfileTransactionList.vue'), diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.spec.js b/frontend/src/views/Layout/DashboardLayout_gdd.spec.js index 8c1e604c0..40b1beac8 100644 --- a/frontend/src/views/Layout/DashboardLayout_gdd.spec.js +++ b/frontend/src/views/Layout/DashboardLayout_gdd.spec.js @@ -75,7 +75,7 @@ describe('DashboardLayoutGdd', () => { }) it('has five items in the navbar', () => { - expect(navbar.findAll('ul > a')).toHaveLength(2) + expect(navbar.findAll('ul > a')).toHaveLength(3) }) it('has first item "send" in navbar', () => { @@ -100,21 +100,21 @@ describe('DashboardLayoutGdd', () => { expect(wrapper.findComponent(RouterLinkStub).props().to).toBe('/transactions') }) - // it('has tree items in the navbar', () => { - // expect(navbar.findAll('ul > li')).toHaveLength(3) - // }) - // - // 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 tree items in the navbar', () => { + expect(navbar.findAll('ul > a')).toHaveLength(3) + }) + + it('has third item "My profile" in navbar', () => { + expect(navbar.findAll('ul > a').at(2).text()).toEqual('site.navbar.my-profil') + }) + + it.skip('has third item "My profile" linked to profile in navbar', async () => { + navbar.findAll('ul > 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') diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue index 5dd4e86a5..81d8b6432 100755 --- a/frontend/src/views/Layout/DashboardLayout_gdd.vue +++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue @@ -1,5 +1,5 @@