Skip to content

Commit a9a1aaf

Browse files
committed
fix(tests): increase tooltip visibility timeout to accomodate for async nature
Signed-off-by: Mohamed Fall <ps.hackmaster@gmail.com>
1 parent 161cb88 commit a9a1aaf

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

packages/react-integration/cypress/integration/button.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ describe('Button Demo Test', () => {
99
.focus()
1010
.should('have.attr', 'aria-describedby', 'button-with-tooltip-1');
1111
});
12-
cy.get('.pf-v6-c-tooltip').should('be.visible');
12+
// Tooltip visibility is async due to requestAnimationFrame-based positioning
13+
cy.get('.pf-v6-c-tooltip', { timeout: 6000 }).should('be.visible');
1314
});
1415

1516
it('Verify isAriaDisabled button has tooltip when hovered', () => {
@@ -18,7 +19,7 @@ describe('Button Demo Test', () => {
1819
.trigger('mouseover')
1920
.should('have.attr', 'aria-describedby', 'button-with-tooltip-1');
2021
});
21-
cy.get('.pf-v6-c-tooltip').should('be.visible');
22+
cy.get('.pf-v6-c-tooltip', { timeout: 6000 }).should('be.visible');
2223
});
2324

2425
it('Verify isAriaDisabled button prevents default actions', () => {

packages/react-integration/cypress/integration/overflowmenu.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('OverflowMenu Demo Test', () => {
3232
it('Verify dropdown menu expanded', () => {
3333
cy.get('#simple-overflow-menu button').last().click({ force: true });
3434
cy.get('#simple-overflow-menu .pf-v6-c-menu-toggle').should('have.class', 'pf-m-expanded');
35-
cy.get('.simple-overflow-menu.pf-v6-c-menu').should('be.visible');
35+
cy.get('.simple-overflow-menu.pf-v6-c-menu', { timeout: 6000 }).should('be.visible');
3636
// close overflow menu again
3737
cy.get('#simple-overflow-menu button').last().click({ force: true });
3838
});
@@ -69,7 +69,7 @@ describe('OverflowMenu Demo Test', () => {
6969
it('Verify dropdown menu expanded', () => {
7070
cy.get('#additional-options-overflow-menu button').last().click({ force: true });
7171
cy.get('#additional-options-overflow-menu .pf-v6-c-menu-toggle').should('have.class', 'pf-m-expanded');
72-
cy.get('.additional-options-overflow-menu.pf-v6-c-menu').should('be.visible');
72+
cy.get('.additional-options-overflow-menu.pf-v6-c-menu', { timeout: 6000 }).should('be.visible');
7373
});
7474
});
7575
});
@@ -107,7 +107,7 @@ describe('OverflowMenu Demo Test', () => {
107107
it('Verify dropdown menu expanded', () => {
108108
cy.get('#persist-overflow-menu button').last().click({ force: true });
109109
cy.get('#persist-overflow-menu .pf-v6-c-menu-toggle').should('have.class', 'pf-m-expanded');
110-
cy.get('.persist-overflow-menu.pf-v6-c-menu').should('be.visible');
110+
cy.get('.persist-overflow-menu.pf-v6-c-menu', { timeout: 6000 }).should('be.visible');
111111
});
112112
});
113113
});
@@ -142,7 +142,7 @@ describe('OverflowMenu Demo Test', () => {
142142
it('Verify dropdown menu expanded', () => {
143143
cy.get('#container-breakpoint-overflow-menu button').last().click({ force: true });
144144
cy.get('#container-breakpoint-overflow-menu .pf-v6-c-menu-toggle').should('have.class', 'pf-m-expanded');
145-
cy.get('.container-breakpoint-overflow-menu.pf-v6-c-menu').should('be.visible');
145+
cy.get('.container-breakpoint-overflow-menu.pf-v6-c-menu', { timeout: 6000 }).should('be.visible');
146146
// close overflow menu again
147147
cy.get('#container-breakpoint-overflow-menu button').last().click({ force: true });
148148
});

packages/react-integration/cypress/integration/tabsdisable.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ describe('Disabled Tab Demo Test', () => {
4040

4141
it('Verify aria-disabled with tooltip', () => {
4242
cy.get(withTooltip.button).trigger('mouseover');
43-
cy.get('.pf-v6-c-tooltip').should('be.visible');
43+
// Tooltip visibility is async due to requestAnimationFrame-based positioning
44+
cy.get('.pf-v6-c-tooltip', { timeout: 6000 }).should('be.visible');
4445
});
4546
});

0 commit comments

Comments
 (0)