diff --git a/e2e/support/helpers/e2e-ui-elements-overflow-helpers.js b/e2e/support/helpers/e2e-ui-elements-overflow-helpers.js index 83f1bed274ec4f51a6f68af585363221de3bd0c3..864f555a485ec76801715ff1300ae4ca0b001f3e 100644 --- a/e2e/support/helpers/e2e-ui-elements-overflow-helpers.js +++ b/e2e/support/helpers/e2e-ui-elements-overflow-helpers.js @@ -34,14 +34,18 @@ export const assertDescendantNotOverflowsContainer = ( return; } - 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, - ); + 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, + ); + }); }; export const assertIsEllipsified = element => {