From 66883ed6d0f48cac6d9debee246c720c253c6904 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Sun, 10 Oct 2021 21:01:32 +0200 Subject: [PATCH] Fix sidebar bug --- .../integration/frontend/sidebar.spec.js | 27 +++++++++++++++++++ client/src/components/ContentBlock.vue | 1 - client/src/components/HeaderBar.vue | 17 ++++++------ client/src/components/MobileHeader.vue | 16 ++++++----- client/src/components/UserWidget.vue | 27 +++---------------- .../components/objective-groups/Objective.vue | 1 - .../src/components/profile/ProfileSidebar.vue | 1 + 7 files changed, 50 insertions(+), 40 deletions(-) create mode 100644 client/cypress/integration/frontend/sidebar.spec.js diff --git a/client/cypress/integration/frontend/sidebar.spec.js b/client/cypress/integration/frontend/sidebar.spec.js new file mode 100644 index 00000000..b4802f59 --- /dev/null +++ b/client/cypress/integration/frontend/sidebar.spec.js @@ -0,0 +1,27 @@ +import {getMinimalMe} from '../../support/helpers'; + +describe('Sidebar', () => { + beforeEach(() => { + cy.setup(); + }); + + it('should open sidebar and stay open', () => { + const operations = { + MeQuery: getMinimalMe({}), + ProjectsQuery: { + projects: [] + } + }; + + cy.mockGraphqlOps({ + operations + }); + + cy.visit('/portfolio'); + cy.getByDataCy('sidebar').should('not.exist'); + cy.getByDataCy('user-widget-avatar').click(); + cy.getByDataCy('sidebar').should('exist'); + cy.getByDataCy('close-profile-sidebar-link').click(); + cy.getByDataCy('sidebar').should('not.exist'); + }); +}); diff --git a/client/src/components/ContentBlock.vue b/client/src/components/ContentBlock.vue index 519ae989..45eb6f63 100644 --- a/client/src/components/ContentBlock.vue +++ b/client/src/components/ContentBlock.vue @@ -9,7 +9,6 @@ class="block-actions" v-if="canEditContentBlock && editModule"> diff --git a/client/src/components/HeaderBar.vue b/client/src/components/HeaderBar.vue index 32600ecf..a69d6cd0 100644 --- a/client/src/components/HeaderBar.vue +++ b/client/src/components/HeaderBar.vue @@ -3,20 +3,22 @@ + @click.stop="openSidebar('navigation')">
- + class="user-header__sidebar-link" > + + data-cy="header-user-widget" + @click.native.stop="openSidebar('profile')"/>
@@ -39,14 +41,13 @@ UserWidget, Logo, CurrentClass, - Hamburger + Hamburger, }, };