From ea4b10b0f2707d6887f7ae18ae494105d8d8ba5a Mon Sep 17 00:00:00 2001 From: Divyanshu Gupta <divyanshugupta585@gmail.com> Date: Wed, 19 Mar 2025 03:17:39 +0530 Subject: [PATCH 1/2] chore(DescriptionList): added keyboard interaction cypress test --- .../cypress/integration/descriptionlist.spec.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/react-integration/cypress/integration/descriptionlist.spec.ts b/packages/react-integration/cypress/integration/descriptionlist.spec.ts index ea42072ec83..8ed6dda198f 100644 --- a/packages/react-integration/cypress/integration/descriptionlist.spec.ts +++ b/packages/react-integration/cypress/integration/descriptionlist.spec.ts @@ -10,5 +10,16 @@ describe('Description List Demo Test', () => { '#description-list-help-text > :nth-child(1) > .pf-v6-c-description-list__term .pf-v6-c-description-list__text' ).click(); cy.get('.pf-v6-c-popover__content').should('exist'); + cy.get('.pf-v6-c-popover__close').click(); + cy.get('.pf-v6-c-popover__content').should('not.exist'); + }); + + it('Verify list with help text using keyboard', () => { + cy.get('#description-list-help-text').should('exist').children('.pf-v6-c-description-list__group'); + cy.get('.pf-v6-c-popover__content').should('not.exist'); + cy.tab().type('{enter}'); + cy.get('.pf-v6-c-popover__content').should('exist'); + cy.get('.pf-v6-c-popover__close').type('{enter}'); + cy.get('.pf-v6-c-popover__content').should('not.exist'); }); }); From 9bbe6a892b523291ab02434daa3ddad2455e469b Mon Sep 17 00:00:00 2001 From: Divyanshu Gupta <divyanshugupta585@gmail.com> Date: Thu, 20 Mar 2025 01:38:59 +0530 Subject: [PATCH 2/2] added test for spacebar --- .../cypress/integration/descriptionlist.spec.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/react-integration/cypress/integration/descriptionlist.spec.ts b/packages/react-integration/cypress/integration/descriptionlist.spec.ts index 8ed6dda198f..0f531400378 100644 --- a/packages/react-integration/cypress/integration/descriptionlist.spec.ts +++ b/packages/react-integration/cypress/integration/descriptionlist.spec.ts @@ -3,7 +3,7 @@ describe('Description List Demo Test', () => { cy.visit('http://localhost:3000/description-list-demo-nav-link'); }); - it('Verify list with help text', () => { + it('Verify list with help text triggered with mouse', () => { cy.get('#description-list-help-text').should('exist').children('.pf-v6-c-description-list__group'); cy.get('.pf-v6-c-popover__content').should('not.exist'); cy.get( @@ -14,7 +14,7 @@ describe('Description List Demo Test', () => { cy.get('.pf-v6-c-popover__content').should('not.exist'); }); - it('Verify list with help text using keyboard', () => { + it('Verify list with help text triggered with enter key', () => { cy.get('#description-list-help-text').should('exist').children('.pf-v6-c-description-list__group'); cy.get('.pf-v6-c-popover__content').should('not.exist'); cy.tab().type('{enter}'); @@ -22,4 +22,13 @@ describe('Description List Demo Test', () => { cy.get('.pf-v6-c-popover__close').type('{enter}'); cy.get('.pf-v6-c-popover__content').should('not.exist'); }); + + it('Verify list with help text triggered with spacebar', () => { + cy.get('#description-list-help-text').should('exist').children('.pf-v6-c-description-list__group'); + cy.get('.pf-v6-c-popover__content').should('not.exist'); + cy.tab().tab().type(' '); + cy.get('.pf-v6-c-popover__content').should('exist'); + cy.get('.pf-v6-c-popover__close').type(' '); + cy.get('.pf-v6-c-popover__content').should('not.exist'); + }); });