Update sidebar test

This commit is contained in:
Ramon Wenger 2021-10-30 21:56:52 +02:00
parent ef6d76aee1
commit 66a0427183
1 changed files with 17 additions and 4 deletions

View File

@ -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');
});