Skip to content

Commit 75e2042

Browse files
test(select): fixed failed select test on firefox
1 parent 606e5ca commit 75e2042

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/kit-headless/src/components/select/select.spec.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,27 @@ describe('Select', () => {
7474
it('should toggle aria-expanded and the listbox should be hidden', () => {
7575
cy.mount(<ThreeOptionSelect />);
7676

77-
cy.get('button').click().should('have.attr', 'aria-expanded', 'true');
78-
79-
// current passed test for now. doesn't work with click for some reason
8077
cy.get('button')
81-
.focus()
82-
.type('{enter}')
78+
.click()
79+
.should('have.attr', 'aria-expanded', 'true')
80+
.click()
8381
.should('have.attr', 'aria-expanded', 'false');
8482

83+
// current passed test for now. doesn't work with click for some reason
84+
8585
cy.findByRole('listbox').should('not.exist');
8686
});
8787

8888
it('should use the arrow keys to navigate options', () => {
8989
cy.mount(<ThreeOptionSelect />);
9090

91-
cy.findByTestId('selectTrigger').type('{enter}');
91+
cy.get('button').focus().click();
9292

9393
cy.findByRole('listbox').should('be.visible');
9494

95-
cy.findByRole('group').type('{downarrow}');
95+
cy.findByRole('group').type(`{downarrow}`);
9696

97-
cy.findByTestId('selectOptionTwo').type('{enter}').should('not.be.visible');
97+
cy.findByTestId('selectOptionTwo').type(`{enter}`).should('not.be.visible');
9898

9999
cy.findByTestId('selectValue').should('have.text', 'Two');
100100
});

0 commit comments

Comments
 (0)