Skip to content

Commit

Permalink
fix accordion e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
alizedebray committed Jul 4, 2024
1 parent 7e1bf77 commit 5b8d69d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/components/cypress/e2e/accordion.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ describe('accordion', () => {
});

it('should only show the first element as expanded', () => {
cy.get('@collapsibles').first().find('.collapse').should('be.visible');
cy.get('@collapsibles').first().shadow().find('post-collapsible').should('be.visible');
});

it('should show the last element as expanded after clicking it', () => {
cy.get('@collapsibles').last().click();
cy.get('@collapsibles').last().find('.collapse').should('be.visible');
cy.get('@collapsibles').last().shadow().find('post-collapsible').should('be.visible');
});

it('should not show the first element as expanded after clicking the last element', () => {
cy.get('@collapsibles').last().click();
cy.get('@collapsibles').first().find('.collapse').should('be.hidden');
cy.get('@collapsibles').first().shadow().find('post-collapsible').should('be.hidden');
});

it('should propagate "postToggle" event from post-accordion-item on post-accordion', () => {
Expand Down Expand Up @@ -73,12 +73,12 @@ describe('accordion', () => {

it('should show the last element as expanded after clicking it', () => {
cy.get('@collapsibles').last().click();
cy.get('@collapsibles').last().find('.collapse').should('be.visible');
cy.get('@collapsibles').last().shadow().find('post-collapsible').should('be.visible');
});

it('should still show the first element as expanded after clicking the last element', () => {
cy.get('@collapsibles').last().click();
cy.get('@collapsibles').first().find('.collapse').should('be.visible');
cy.get('@collapsibles').first().shadow().find('post-collapsible').should('be.visible');
});
});
});
Expand Down

0 comments on commit 5b8d69d

Please sign in to comment.