-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[code-infra] Prepare some tests to work in vitest/playwright
#14926
Conversation
Deploy preview: https://deploy-preview-14926--material-ui-x.netlify.app/ |
test
rendering logictest
rendering logic
test
rendering logicvitest/playwright
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.
LGTM, but I'd leave the approval right to xGrid because of the comment. 🤔
const isColDefWidth114Present = colDefWidthArgs.some((width) => width === 114); | ||
expect(isColDefWidth114Present).to.equal(true); | ||
const widthArgs = onColumnWidthChange.args.map((arg) => Math.round(arg[0].width)); | ||
expect(widthArgs).to.deep.equal([120, 64]); |
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.
IMHO, this needs a review from xGrid as it looks like something functional has changed. 🤔
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.
Yeah, the scrollbar is not rendered, so the size is different.
It took me a while to find the actual issue.
As I said, there are two options:
- Test all without scrollbar
- Enable scrollbars to all playwright tests if the scrollbar is important
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.
Noticed the CI is still erroring on the changes, I might have to go with 2 regardless for this specific error 😓
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.
As I said, there are two options:
- Test all without scrollbar
- Enable scrollbars to all playwright tests if the scrollbar is important
But why did the behavior of the scrollbar change if the playwright
package had not been bumped? 🤔
Is it the same issue blocking us here: #13672?
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.
No, they are unrelated.
Behaviour is based on the browser arguments, karma is using the playwright browser executable only, and passing its own arguments in, which means it shows scrollbars in headless mode.
Playwright on the other hand, passes their own arguments in, which means it will hide the scrollbars in headless mode .
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've reverted the changes specific to scrollbar, as the 2nd option seems to fix it cleanly.
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.
Cool. 👍
LGTM then, I've restarted a flaky unit test. 😉
This reverts commit db554b9.
Porting a change from #14508
Basically making the render independent from other test runs by not having a globally defined variable for the test.
Also removes
done()
from two tests 😅### ScrollbarsThe changes on columns.DataGridPro.test.tsx are due to playwright not displaying scrollbars by default.If it is desirable to display the scrollbars, then I can revert this and force playwright to show them in headless mode instead.