Skip to content

Commit 6536eb3

Browse files
authored
chore(DescriptionList): added keyboard interaction cypress test (#11689)
* chore(DescriptionList): added keyboard interaction cypress test * added test for spacebar
1 parent 25558ac commit 6536eb3

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

Diff for: packages/react-integration/cypress/integration/descriptionlist.spec.ts

+21-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,32 @@ describe('Description List Demo Test', () => {
33
cy.visit('http://localhost:3000/description-list-demo-nav-link');
44
});
55

6-
it('Verify list with help text', () => {
6+
it('Verify list with help text triggered with mouse', () => {
77
cy.get('#description-list-help-text').should('exist').children('.pf-v6-c-description-list__group');
88
cy.get('.pf-v6-c-popover__content').should('not.exist');
99
cy.get(
1010
'#description-list-help-text > :nth-child(1) > .pf-v6-c-description-list__term .pf-v6-c-description-list__text'
1111
).click();
1212
cy.get('.pf-v6-c-popover__content').should('exist');
13+
cy.get('.pf-v6-c-popover__close').click();
14+
cy.get('.pf-v6-c-popover__content').should('not.exist');
15+
});
16+
17+
it('Verify list with help text triggered with enter key', () => {
18+
cy.get('#description-list-help-text').should('exist').children('.pf-v6-c-description-list__group');
19+
cy.get('.pf-v6-c-popover__content').should('not.exist');
20+
cy.tab().type('{enter}');
21+
cy.get('.pf-v6-c-popover__content').should('exist');
22+
cy.get('.pf-v6-c-popover__close').type('{enter}');
23+
cy.get('.pf-v6-c-popover__content').should('not.exist');
24+
});
25+
26+
it('Verify list with help text triggered with spacebar', () => {
27+
cy.get('#description-list-help-text').should('exist').children('.pf-v6-c-description-list__group');
28+
cy.get('.pf-v6-c-popover__content').should('not.exist');
29+
cy.tab().tab().type(' ');
30+
cy.get('.pf-v6-c-popover__content').should('exist');
31+
cy.get('.pf-v6-c-popover__close').type(' ');
32+
cy.get('.pf-v6-c-popover__content').should('not.exist');
1333
});
1434
});

0 commit comments

Comments
 (0)