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

[DataView] Initial list of unit tests for the DataView component #68205

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

louwie17
Copy link
Contributor

@louwie17 louwie17 commented Dec 20, 2024

What?

Adds an initial set of unit tests for the DataViews component:

  • Showing the "no results" if no data
  • Displays filtered data if enableGlobalSearch and search is used
  • The use of elements label when viewing the data and the custom render function
  • Displaying all the data within each view ( table, grid, and list )
  • Table
    • To test if the columns are rendered and also the action column ( if actions exist )
    • Test the onClickItem
  • Grid
    • Test mediaField option and actions dropdown
    • Test the onClickItem
  • List
    • Test if the actions dropdown is displayed

Testing Instructions

  1. Run the unit tests using: npm run test:unit -- --testPathPattern=packages/dataviews and make sure they run successfully.

@louwie17 louwie17 added the [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond label Dec 20, 2024
Copy link

Flaky tests detected in 21e4f84.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12435147141
📝 Reported issues:

@louwie17 louwie17 added [Type] Code Quality Issues or PRs that relate to code quality [Package] DataViews /packages/dataviews labels Dec 23, 2024
@louwie17 louwie17 marked this pull request as ready for review December 23, 2024 12:34
Copy link

github-actions bot commented Dec 23, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: louwie17 <louwie17@git.wordpress.org>
Co-authored-by: oandregal <oandregal@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Member

@oandregal oandregal left a comment

Choose a reason for hiding this comment

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

I wish there was a way to connect the stories in the storybook with unit tests. I feel we're replicating a bit (e.g.: empty states). As it stands, both things provide value in different ways.

@oandregal oandregal merged commit 854a9bc into trunk Dec 24, 2024
75 of 77 checks passed
@oandregal oandregal deleted the add/dataviews_unit_tests branch December 24, 2024 13:09
@github-actions github-actions bot added this to the Gutenberg 20.0 milestone Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Package] DataViews /packages/dataviews [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants