From f3289ba8810eab834c92317bc5db7ed0d1c10624 Mon Sep 17 00:00:00 2001 From: Christian Cueni Date: Mon, 8 Apr 2019 17:11:08 +0200 Subject: [PATCH] add subnavigation, minor cleanup --- .../integration/change-password-spec.js | 24 ++++++------- client/src/components/PasswordChange.vue | 4 +-- client/src/components/TopNavigation.vue | 17 --------- client/src/components/UserWidget.vue | 24 +++++++++---- client/src/layouts/DefaultLayout.vue | 7 ++-- client/src/pages/passwordChange.vue | 10 ------ client/src/pages/profile.vue | 35 ++++++++++++++++++- client/src/router/index.js | 13 +++++-- client/src/styles/_top-navigation.scss | 15 ++++++++ client/src/styles/main.scss | 1 + server/users/serializers.py | 3 -- 11 files changed, 98 insertions(+), 55 deletions(-) create mode 100644 client/src/styles/_top-navigation.scss diff --git a/client/cypress/integration/change-password-spec.js b/client/cypress/integration/change-password-spec.js index ff1f645e..e5b623dc 100644 --- a/client/cypress/integration/change-password-spec.js +++ b/client/cypress/integration/change-password-spec.js @@ -12,7 +12,7 @@ describe('Change Password Page', () => { it('shows an empty form', () => { cy.login('rahel.cueni', 'test'); - cy.visit('/password-change'); + cy.visit('/me/password-change'); cy.get('[data-cy=password-change-success]').should('not.exist'); cy.get('[data-cy=old-password]').should('have.value', ''); @@ -21,15 +21,15 @@ describe('Change Password Page', () => { it('shows errors if old password is not entered', () => { cy.login('rahel.cueni', 'test'); - cy.visit('/password-change'); + cy.visit('/me/password-change'); cy.changePassword('', validNewPassword); cy.get('[data-cy=old-password-local-errors]').should('contain', 'Dein aktuelles Passwort fehlt') }); - it('shows errors if old password is not entered', () => { + it('shows errors if new password is not entered', () => { cy.login('rahel.cueni', 'test'); - cy.visit('/password-change'); + cy.visit('/me/password-change'); cy.changePassword(validOldPassword, ''); cy.get('[data-cy=new-password-local-errors]').should('contain', 'Dein neues Passwort fehlt') @@ -37,7 +37,7 @@ describe('Change Password Page', () => { it('shows errors if new password is too short', () => { cy.login('rahel.cueni', 'test'); - cy.visit('/password-change'); + cy.visit('/me/password-change'); cy.changePassword(validOldPassword, 'Abc1!'); cy.get('[data-cy=new-password-local-errors]').should('contain', validationTooShort) @@ -45,7 +45,7 @@ describe('Change Password Page', () => { it('shows errors if new password has no uppercase letter', () => { cy.login('rahel.cueni', 'test'); - cy.visit('/password-change'); + cy.visit('/me/password-change'); cy.changePassword(validOldPassword, 'aabdddedddbc1!'); cy.get('[data-cy=new-password-local-errors]').should('contain', validationErrorMsg) @@ -53,7 +53,7 @@ describe('Change Password Page', () => { it('shows errors if new password has no lowercase letter', () => { cy.login('rahel.cueni', 'test'); - cy.visit('/password-change'); + cy.visit('/me/password-change'); cy.changePassword(validOldPassword, 'ABCDDD334551!'); cy.get('[data-cy=new-password-local-errors]').should('contain', validationErrorMsg) @@ -61,7 +61,7 @@ describe('Change Password Page', () => { it('shows errors if new password has no digit', () => { cy.login('rahel.cueni', 'test'); - cy.visit('/password-change'); + cy.visit('/me/password-change'); cy.changePassword(validOldPassword, 'AbcdEEDE!'); cy.get('[data-cy=new-password-local-errors]').should('contain', validationErrorMsg) @@ -69,7 +69,7 @@ describe('Change Password Page', () => { it('shows errors if new password has no special character', () => { cy.login('rahel.cueni', 'test'); - cy.visit('/password-change'); + cy.visit('/me/password-change'); cy.changePassword(validOldPassword, 'AbcdEEDE09877'); cy.get('[data-cy=new-password-local-errors]').should('contain', validationErrorMsg) @@ -77,7 +77,7 @@ describe('Change Password Page', () => { it('shows errors if old password does not match', () => { cy.login('rahel.cueni', 'test'); - cy.visit('/password-change'); + cy.visit('/me/password-change'); cy.changePassword('test12345', validNewPassword); cy.get('[data-cy=old-password-remote-errors]').should('contain', validationOldWrongMsg) @@ -85,9 +85,9 @@ describe('Change Password Page', () => { it('shows success if change was successful', () => { cy.login('rahel.cueni', 'test'); - cy.visit('/password-change'); + cy.visit('/me/password-change'); - cy.changePassword('test', validNewPassword); + cy.changePassword(validOldPassword, validNewPassword); cy.get('[data-cy=password-change-success]').should('contain', 'Dein Password wurde erfolgreich geändert.'); cy.get('[data-cy=old-password]').should('have.value', ''); cy.get('[data-cy=new-password]').should('have.value', ''); diff --git a/client/src/components/PasswordChange.vue b/client/src/components/PasswordChange.vue index c7c737af..808e98a2 100644 --- a/client/src/components/PasswordChange.vue +++ b/client/src/components/PasswordChange.vue @@ -2,7 +2,7 @@
- + {{ errors.first('newPassword') }} {{ error }}
- +
diff --git a/client/src/components/TopNavigation.vue b/client/src/components/TopNavigation.vue index 0d278098..b4b7ccaa 100644 --- a/client/src/components/TopNavigation.vue +++ b/client/src/components/TopNavigation.vue @@ -22,21 +22,4 @@ diff --git a/client/src/components/UserWidget.vue b/client/src/components/UserWidget.vue index 2d923914..1479d8ed 100644 --- a/client/src/components/UserWidget.vue +++ b/client/src/components/UserWidget.vue @@ -1,16 +1,18 @@