- cy.get('p').contains('Projects').closest('div[role=button]')
- .within(() => {
- cy.get('svg[role=presentation]')
- .click({ multiple: true });
- });
+ // must use .then to avoid selecting instead of expanding https://github.com/cypress-io/cypress/issues/5529
+ cy.get('p').contains('Home Projects').closest('ul')
+ .find('i')
+ .then(el => el.click());