diff --git a/e2e/support/helpers/e2e-ui-elements-overflow-helpers.js b/e2e/support/helpers/e2e-ui-elements-overflow-helpers.js index 864f555a485ec76801715ff1300ae4ca0b001f3e..83f1bed274ec4f51a6f68af585363221de3bd0c3 100644 --- a/e2e/support/helpers/e2e-ui-elements-overflow-helpers.js +++ b/e2e/support/helpers/e2e-ui-elements-overflow-helpers.js @@ -34,18 +34,14 @@ export const assertDescendantNotOverflowsContainer = ( return; } - cy.wrap(descendantRect).should($descendantRect => { - expect($descendantRect.bottom, `${message} bottom`).to.be.lte( - containerRect.bottom, - ); - expect($descendantRect.top, `${message} top`).to.be.gte(containerRect.top); - expect($descendantRect.left, `${message} left`).to.be.gte( - containerRect.left, - ); - expect($descendantRect.right, `${message} right`).to.be.lte( - containerRect.right, - ); - }); + expect(descendantRect.bottom, `${message} bottom`).to.be.lte( + containerRect.bottom, + ); + expect(descendantRect.top, `${message} top`).to.be.gte(containerRect.top); + expect(descendantRect.left, `${message} left`).to.be.gte(containerRect.left); + expect(descendantRect.right, `${message} right`).to.be.lte( + containerRect.right, + ); }; export const assertIsEllipsified = element => { diff --git a/e2e/test/scenarios/dashboard-cards/dashboard-card-reproductions.cy.spec.js b/e2e/test/scenarios/dashboard-cards/dashboard-card-reproductions.cy.spec.js index 59b27a553a8d04264b53c66907fa64b8d42b269b..1f4d2453744822547c98ef370642e631aed33c6b 100644 --- a/e2e/test/scenarios/dashboard-cards/dashboard-card-reproductions.cy.spec.js +++ b/e2e/test/scenarios/dashboard-cards/dashboard-card-reproductions.cy.spec.js @@ -1095,15 +1095,17 @@ describe("issue 31628", () => { }; const assertDescendantsNotOverflowDashcards = descendantsSelector => { - cy.findAllByTestId("dashcard").each((dashcard, dashcardIndex) => { - const descendants = dashcard.find(descendantsSelector); - - descendants.each((_descendantIndex, descendant) => { - assertDescendantNotOverflowsContainer( - descendant, - dashcard[0], - `dashcard[${dashcardIndex}] [data-testid="${descendant.dataset.testid}"]`, - ); + cy.findAllByTestId("dashcard").should(dashcards => { + dashcards.each((dashcardIndex, dashcard) => { + const descendants = dashcard.querySelectorAll(descendantsSelector); + + descendants.forEach(descendant => { + assertDescendantNotOverflowsContainer( + descendant, + dashcard, + `dashcard[${dashcardIndex}] [data-testid="${descendant.dataset.testid}"]`, + ); + }); }); }); };