Skip to content

Improve browser tests #3547

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

Merged
merged 101 commits into from
Jul 18, 2024
Merged

Improve browser tests #3547

merged 101 commits into from
Jul 18, 2024

Conversation

amanmahajan7
Copy link
Contributor

@amanmahajan7 amanmahajan7 commented Jul 15, 2024

  • Use Vitest helpers to simulate copy/paste
  • Remove scrollIntoView mock and check grid position instead

Base automatically changed from am-vitest-browser to main July 16, 2024 14:52
@amanmahajan7 amanmahajan7 marked this pull request as ready for review July 16, 2024 16:51
@amanmahajan7 amanmahajan7 requested a review from nstepien as a code owner July 16, 2024 16:51
expect(getSelectedCell()).not.toHaveClass(copyCellClassName);
expect(onCopySpy).not.toHaveBeenCalled();
await userEvent.keyboard('{arrowdown}');
pasteSelectedCell();
await userEvent.keyboard('{enter}{arrowdown}');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Enter closes the editor

Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the editor open at this point?

Copy link
Contributor Author

@amanmahajan7 amanmahajan7 Jul 18, 2024

Choose a reason for hiding this comment

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

I forgot about this change. I thought the empty cell was the editor. I will investigate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is actually the paste operation that triggers the editor. Also, escape does not work with null editor

@amanmahajan7 amanmahajan7 merged commit dacffef into main Jul 18, 2024
3 checks passed
@amanmahajan7 amanmahajan7 deleted the am-improve-test branch July 18, 2024 13:35
adityatoshniwal pushed a commit to pgadmin-org/react-data-grid that referenced this pull request Jul 31, 2024
- Use Vitest helpers to simulate copy/paste
- Remove `scrollIntoView` mock and check grid position instead
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