From 66a0427183026b90848556f3e713e0abed20e4fc Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Sat, 30 Oct 2021 21:56:52 +0200 Subject: [PATCH] Update sidebar test --- .../integration/frontend/sidebar.spec.js | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/client/cypress/integration/frontend/sidebar.spec.js b/client/cypress/integration/frontend/sidebar.spec.js index b4802f59..9163015f 100644 --- a/client/cypress/integration/frontend/sidebar.spec.js +++ b/client/cypress/integration/frontend/sidebar.spec.js @@ -6,21 +6,34 @@ describe('Sidebar', () => { }); it('should open sidebar and stay open', () => { + const {me} = getMinimalMe({}); const operations = { - MeQuery: getMinimalMe({}), + MeQuery: { + me: { + ...me, + schoolClasses: { + edges: [ + ...me.schoolClasses.edges, + {node: {}}, + ], + }, + }, + }, ProjectsQuery: { - projects: [] - } + projects: [], + }, }; cy.mockGraphqlOps({ - operations + operations, }); cy.visit('/portfolio'); cy.getByDataCy('sidebar').should('not.exist'); cy.getByDataCy('user-widget-avatar').click(); cy.getByDataCy('sidebar').should('exist'); + cy.getByDataCy('class-selection').click(); + cy.getByDataCy('class-selection-entry').should('have.length', 2); cy.getByDataCy('close-profile-sidebar-link').click(); cy.getByDataCy('sidebar').should('not.exist'); });