-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(QDialog): add QDialog tests #16636
Conversation
UI Tests Results0 tests 0 ✅ 0s ⏱️ For more details on these parsing errors, see this check. Results for commit e26f9ee. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work!
Aside some dead code around and a couple readability fixes, everything seems fine
I have resolved the issues with the PR. As concerns the function handleHide (evt) {
hidePortal() // The dialog is hidden
// Some code here. It's how fast this happens that determines if the test will pass or fail
emit('hide', evt)
} While in the test looks something like this: cy.dataCy('method-hide')
.click({ force: true })
cy.dataCy('menu')
.should('not.exist')
.then(() => {
expect(fn).to.be.called
})
With the cy.dataCy('dialog-page').then(() => {
1) cy.dataCy('input-field').focus()
2) model.value = true
cy.withinDialog(() => {
closeDialog()
})
cy.dataCy('input-field').should('have.focus')
}) It has a similar problem to the cy.dataCy('input-field')
.type('Hello')
cy.dataCy('input-field')
.should('have.value', 'Hello').then(() => {
model.value = true
cy.withinDialog(() => {
closeDialogViaBackdrop()
})
getHostElement()
.should('not.exist').then(() => {
cy.dataCy('input-field')
.should('have.focus')
})
}) I have made similar changes to the rest of |
f981664
to
01c2b82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments to highlight some changes I did and explain to which pitfalls you need to pay attention
I didn't complete the refactor, but I marked with a comment up until where I did it
Good luck
c810c0a
to
e7f881d
Compare
This comment has been minimized.
This comment has been minimized.
… stopping animation on QMenu to fix event issues - After a dialog has been closed, the hide event is fired only after the duration transitionDuration has elapsed. transitionDuration is a prop passed to use-model-toggle.js and has a default value of 300ms. Hence, we cannot depend on the dialog closing to conclude that the event has been fired. Setting transitionDuration to 0 ensures it fires immediately
e7f881d
to
4d10665
Compare
…ansition duration prop
4d10665
to
e26f9ee
Compare
Build ResultsJSON API📜 No changes detected. Types📜 No changes detected. |
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
The PR fulfills these requirements:
dev
branch (orv[X]
branch)fix: #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information: