-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from jon-coffey/master
- Loading branch information
Showing
15 changed files
with
675 additions
and
391 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
Cypress.on('scrolled', element => { | ||
// When we do `cy.get()` the Cypress finds the element | ||
// and scrolls down, thus this element becomes at the very top | ||
// of the page. | ||
// `tippy.js` will not show tooltips if they appeared in an invisible | ||
// part of the window. | ||
element.get(0).scrollIntoView({ | ||
block: 'center', | ||
inline: 'center' | ||
}); | ||
}); | ||
|
||
describe('@ngneat/helipopper/is_visible', () => { | ||
const popperSelector = '.tippy-box .tippy-content'; | ||
|
||
describe('isVisible attribute', () => { | ||
beforeEach(() => { | ||
cy.visit('/').wait(200); | ||
}); | ||
|
||
it('should not be visible while flag is false', () => { | ||
cy.get('.declarativeTooltip').should('not.exist'); | ||
}); | ||
it('should be visible while flag is true', () => { | ||
cy.get('[data-cy~="trigger-declarative"]').click({ force: true }); | ||
cy.get(popperSelector).contains("I'm a declarative tooltip"); | ||
cy.get('[data-cy~="trigger-declarative"]').click({ force: true }); | ||
cy.get('.declarativeTooltip').should('not.exist'); | ||
}); | ||
}); | ||
|
||
describe('isVisible attribute with initial value true', () => { | ||
beforeEach(() => { | ||
cy.visit('/is-visible').wait(200); | ||
}); | ||
|
||
it('should be visible while flag is already set true before view renders', () => { | ||
cy.get(popperSelector).contains("I'm a declarative tooltip"); | ||
}); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.