Skip to content

Commit

Permalink
Click on toggle element in BulkSelect tests
Browse files Browse the repository at this point in the history
  • Loading branch information
randomnetcat committed Jul 5, 2024
1 parent bd9227f commit 4fa7f9b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/components/src/BulkSelect/BulkSelect.spec.ct.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ describe('BulkSelect component', () => {
it('renders component with data', () => {
cy.mount(<BulkSelect {...config} />);
cy.get('#toggle-checkbox').should('contain.text', '100');
cy.get('.pf-v5-c-menu-toggle').click();
cy.get('.pf-v5-c-menu-toggle__controls').click();
// PF has one extra hidden button element
cy.get('.pf-v5-c-menu__list').find('>li>button').should('have.length', 3);
});

it('cannot be expanded or checked when disabled', () => {
cy.mount(<BulkSelect {...config} isDisabled={true} />);
cy.get('.pf-v5-c-menu-toggle').click({ force: true });
cy.get('.pf-v5-c-menu-toggle__controls').click({ force: true });
cy.get('.pf-v5-c-menu__list').should('not.exist');
cy.get('input[name="toggle-checkbox"]').check({ force: true });
cy.get('input[name="toggle-checkbox"]').should('not.be.checked');
Expand All @@ -44,9 +44,9 @@ describe('BulkSelect component', () => {
config.items[1].onClick = cy.spy().as('disabledSpy');
config.onClick = cy.spy().as('checkboxSpy');
cy.mount(<BulkSelect {...config} />);
cy.get('.pf-v5-c-menu-toggle').click();
cy.get('.pf-v5-c-menu-toggle__controls').click();
cy.get('.pf-v5-c-menu__list').find('>li>button').eq(1).click();
cy.get('.pf-v5-c-menu-toggle').click();
cy.get('.pf-v5-c-menu-toggle__controls').click();
cy.get('.pf-v5-c-menu__list').find('>li>button').eq(2).click({ force: true });
cy.get('input[name="toggle-checkbox"]').check();
cy.get('@enabledSpy').should('have.been.called');
Expand Down

0 comments on commit 4fa7f9b

Please sign in to comment.