diff --git a/packages/driver/cypress/e2e/dom/visibility.cy.ts b/packages/driver/cypress/e2e/dom/visibility.cy.ts index 5dc7495afc30..fc747350b5c3 100644 --- a/packages/driver/cypress/e2e/dom/visibility.cy.ts +++ b/packages/driver/cypress/e2e/dom/visibility.cy.ts @@ -246,9 +246,7 @@ describe('src/cypress/dom/visibility', () => { this.$parentNoWidth = add(`\
-
parent width: 0 -
`) this.$parentNoHeight = add(`\ @@ -263,11 +261,28 @@ describe('src/cypress/dom/visibility', () => { this.$parentWithWidthHeightNoOverflow = add(`\
-
parent with size, overflow: hidden -
`) + this.$ancestorWithWidthHeightNoOverflow = add(`\ +
+
parent with size, overflow: hidden
+
`) + + this.$ancestorNoWidth = add(`\ +
+
+ ancestor width: 0 +
+
`) + + this.$ancestorNoHeight = add(`\ +
+
+ ancestor height: 0 +
+
`) + this.$childPosAbs = add(`\
@@ -742,10 +757,25 @@ describe('src/cypress/dom/visibility', () => { expect(this.$parentNoHeight.find('span')).to.not.be.visible }) + it('is hidden if ancestor has overflow:hidden and no width', function () { + expect(this.$ancestorNoWidth.find('span')).to.be.hidden + expect(this.$ancestorNoWidth.find('span')).to.not.be.visible + }) + + it('is hidden if ancestor has overflow:hidden and no height', function () { + expect(this.$ancestorNoHeight.find('span')).to.be.hidden + expect(this.$ancestorNoHeight.find('span')).to.not.be.visible + }) + it('is visible when parent has positive dimensions even with overflow hidden', function () { expect(this.$parentWithWidthHeightNoOverflow.find('span')).to.be.visible expect(this.$parentWithWidthHeightNoOverflow.find('span')).to.not.be.hidden }) + + it('is visible when ancestor has positive dimensions even with overflow hidden', function () { + expect(this.$ancestorWithWidthHeightNoOverflow.find('span')).to.be.visible + expect(this.$ancestorWithWidthHeightNoOverflow.find('span')).to.not.be.hidden + }) }) describe('css position', () => {