Skip to content
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

Use vitest-browser-react and browserUserEvent #3629

Merged
merged 19 commits into from
Nov 15, 2024
Merged

Conversation

amanmahajan7
Copy link
Contributor

@amanmahajan7 amanmahajan7 self-assigned this Nov 12, 2024
Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.83%. Comparing base (8685a70) to head (6519308).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3629      +/-   ##
==========================================
+ Coverage   91.02%   91.83%   +0.81%     
==========================================
  Files          48       48              
  Lines        3453     3453              
  Branches      667      686      +19     
==========================================
+ Hits         3143     3171      +28     
+ Misses        310      282      -28     

see 10 files with indirect coverage changes

@@ -707,7 +707,7 @@ export default [
'testing-library/prefer-presence-queries': 1,
'testing-library/prefer-query-by-disappearance': 1,
'testing-library/prefer-query-matchers': 0,
'testing-library/prefer-screen-queries': 1,
'testing-library/prefer-screen-queries': 0,
Copy link
Contributor Author

@amanmahajan7 amanmahajan7 Nov 13, 2024

Choose a reason for hiding this comment

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

Had to disable it as this complains about page...

name: 'Name',
renderEditCell: textEditor,
editorOptions: {
commitOnOutsideClick: false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this so we can test the blur event

await new Promise(requestAnimationFrame);
});
await user.pointer({ keys: '[/MouseLeft]' });
await userEvent.click(saveButton, { delay: 10 });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

😎

Comment on lines 290 to 292
await waitFor(() => {
expect(col1Input).not.toBeInTheDocument();
expect(col1Input.query()).not.toBeInTheDocument();
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need a better way

@amanmahajan7 amanmahajan7 marked this pull request as ready for review November 13, 2024 16:22
@amanmahajan7 amanmahajan7 changed the title Try out vitest-browser-react Use vitest-browser-react and browserUserEvent Nov 13, 2024
test/setupBrowser.ts Outdated Show resolved Hide resolved
test/browser/column/renderEditCell.test.tsx Outdated Show resolved Hide resolved
test/browser/column/renderEditCell.test.tsx Outdated Show resolved Hide resolved
test/browser/column/renderEditCell.test.tsx Outdated Show resolved Hide resolved
@amanmahajan7 amanmahajan7 enabled auto-merge (squash) November 15, 2024 21:45
@amanmahajan7 amanmahajan7 merged commit 19d5487 into main Nov 15, 2024
3 checks passed
@amanmahajan7 amanmahajan7 deleted the vitest-browser-react branch November 15, 2024 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants