forked from DouyinFE/semi-design
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tooltip): leftTopOver supports autoAdjustOverflow DouyinFE#294 (D…
- Loading branch information
1 parent
c33c463
commit 19d7acc
Showing
9 changed files
with
181 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"projectId": "k83u7j" | ||
"projectId": "k83u7j", | ||
"scrollBehavior": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// tooltip.spec.js created with Cypress | ||
// | ||
// Start writing your Cypress tests below! | ||
// If you're unfamiliar with how Cypress works, | ||
// check out the link below and learn how to write your first test: | ||
// https://on.cypress.io/writing-first-test | ||
|
||
/** | ||
* Cypress will default scroll element into view | ||
* @see https://docs.cypress.io/guides/core-concepts/interacting-with-elements#Scrolling | ||
*/ | ||
describe('tooltip', () => { | ||
it('leftTopOver autoAdjustOverflow', () => { | ||
const viewportWidth = 1200; | ||
const viewportHeight = 660; | ||
const triggerWidth = 200; | ||
const triggerHeight = 32; | ||
const leftTopPosition = { offset: { top: 0, left: 0 }}; | ||
const rightBottomPosition = { offset: { top: -viewportHeight + triggerHeight, left: -viewportWidth + triggerWidth }}; | ||
cy.visit('http://127.0.0.1:6006/iframe.html?id=tooltip--left-top-over-auto-adjust-overflow&args=&viewMode=story'); | ||
cy.viewport(viewportWidth, viewportHeight); | ||
const dataSelector = `[data-cy=leftTopOver]`; | ||
cy.get(dataSelector).scrollIntoView(leftTopPosition); | ||
cy.get(dataSelector).click({force: true}); | ||
cy.get('[x-placement="leftTopOver"]').should('have.length', 1); | ||
cy.get(dataSelector).scrollIntoView(rightBottomPosition); | ||
cy.get('[x-placement="rightBottomOver"]').should('have.length', 1); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters