Skip to content

Commit

Permalink
adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mschile committed Jan 24, 2025
1 parent f907d0a commit afb6ecc
Showing 1 changed file with 112 additions and 0 deletions.
112 changes: 112 additions & 0 deletions packages/driver/cypress/e2e/dom/visibility.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,118 @@ describe('src/cypress/dom/visibility', () => {
cy.get('optgroup').should('be.visible')
cy.get('select').should('be.visible')
})

it('is visible when x direction is clip but element is visible in y direction', () => {
cy.$$('body').empty()

add(`
<div style="overflow-x: clip">
<div style="height: 100px; width: 500px;">
<div style="height: 100px; width: 500px;"></div>
<input type="radio"/>
<label>Visible</label>
</div>
</div>
`)

cy.get('label').should('be.visible')
})

it('is hidden when x direction is hidden and y direction is coerced by browser to auto', () => {
cy.$$('body').empty()

add(`
<div style="overflow-x: hidden">
<div style="height: 100px; width: 500px;">
<div style="height: 100px; width: 500px;"></div>
<input type="radio"/>
<label>Hidden</label>
</div>
</div>
`)

cy.get('label').should('not.be.visible')
})

it('is hidden when x direction is auto and y direction is coerced by browser to auto', () => {
cy.$$('body').empty()

add(`
<div style="overflow-x: auto">
<div style="height: 100px; width: 500px;">
<div style="height: 100px; width: 500px;"></div>
<input type="radio"/>
<label>Hidden</label>
</div>
</div>
`)

cy.get('label').should('not.be.visible')
})

it('is hidden when y direction is hidden and x direction is set to clip but coerced by browser to hidden', () => {
cy.$$('body').empty()

add(`
<div style="overflow-x: clip; overflow-y: hidden">
<div style="height: 100px; width: 500px;">
<div style="height: 100px; width: 500px;"></div>
<input type="radio"/>
<label>Hidden</label>
</div>
</div>
`)

cy.get('label').should('not.be.visible')
})

it('is hidden when y direction is auto and x direction is set to clip but coerced by browser to hidden', () => {
cy.$$('body').empty()

add(`
<div style="overflow-x: clip; overflow-y: auto">
<div style="height: 100px; width: 500px;">
<div style="height: 100px; width: 500px;"></div>
<input type="radio"/>
<label>Hidden</label>
</div>
</div>
`)

cy.get('label').should('not.be.visible')
})

it('is visible when x direction is clip and y direction is visible', () => {
cy.$$('body').empty()

add(`
<div style="overflow-x: clip; overflow-y: visible">
<div style="height: 100px; width: 500px;">
<div style="height: 100px; width: 500px;"></div>
<input type="radio"/>
<label>Visible</label>
</div>
</div>
`)

cy.get('label').should('be.visible')
})

it('is hidden when y direction is overriden by setting overflow to clip', () => {
cy.$$('body').empty()

add(`
<div style="overflow-y: visible; overflow: clip;">
<div style="height: 100px; width: 500px;">
<div style="height: 100px; width: 500px;"></div>
<input type="radio"/>
<label>Hidden</label>
</div>
</div>
`)

cy.get('label').should('not.be.visible')
})
})

describe('css clip-path', () => {
Expand Down

5 comments on commit afb6ecc

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on afb6ecc Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.1/linux-arm64/mschile/issue-30922-afb6ecc4dd491351ad2ab737d868dbc89d1a8e61/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on afb6ecc Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.1/linux-x64/mschile/issue-30922-afb6ecc4dd491351ad2ab737d868dbc89d1a8e61/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on afb6ecc Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.1/win32-x64/mschile/issue-30922-afb6ecc4dd491351ad2ab737d868dbc89d1a8e61/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on afb6ecc Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.1/darwin-arm64/mschile/issue-30922-afb6ecc4dd491351ad2ab737d868dbc89d1a8e61/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on afb6ecc Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.1/darwin-x64/mschile/issue-30922-afb6ecc4dd491351ad2ab737d868dbc89d1a8e61/cypress.tgz

Please sign in to comment.