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

[BD-46] feat: move Enzyme to React testing library #2440 #2581

Merged

Conversation

khudym
Copy link
Contributor

@khudym khudym commented Aug 30, 2023

Description

Include a description of your changes here, along with a link to any relevant Jira tickets and/or Github issues.

Deploy Preview

Include a direct link to your changes in this PR's deploy preview here (e.g., a specific component page).

Merge Checklist

  • If your update includes visual changes, have they been reviewed by a designer? Send them a link to the Netlify deploy preview, if applicable.
  • Does your change adhere to the documented style conventions?
  • Do any prop types have missing descriptions in the Props API tables in the documentation site (check deploy preview)?
  • Were your changes tested using all available themes (see theme switcher in the header of the deploy preview, under the "Settings" icon)?
  • Were your changes tested in the example app?
  • Is there adequate test coverage for your changes?
  • Consider whether this change needs to reviewed/QA'ed for accessibility (a11y). If so, please add wittjeff and adamstankiewicz as reviewers on this PR.

Post-merge Checklist

  • Verify your changes were released to NPM at the expected version.
  • If you'd like, share your contribution in #show-and-tell.
  • 🎉 🙌 Celebrate! Thanks for your contribution.

@openedx-webhooks
Copy link

openedx-webhooks commented Aug 30, 2023

Thanks for the pull request, @khudym!

When this pull request is ready, tag your edX technical lead.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Aug 30, 2023
@netlify
Copy link

netlify bot commented Aug 30, 2023

Deploy Preview for paragon-openedx ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6fc6386
🔍 Latest deploy log https://app.netlify.com/sites/paragon-openedx/deploys/652691b96a98800008e41995
😎 Deploy Preview https://deploy-preview-2581--paragon-openedx.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@khudym khudym changed the title Zadorozhnii/refactor enzyme tests [BD-46] feat: move Enzyme to React testing library #2440 Aug 30, 2023
@openedx-webhooks openedx-webhooks added blended PR is managed through 2U's blended developmnt program and removed open-source-contribution PR author is not from Axim or 2U labels Aug 30, 2023
@adamstankiewicz adamstankiewicz linked an issue Sep 1, 2023 that may be closed by this pull request
src/Chip/Chip.test.jsx Outdated Show resolved Hide resolved
src/Chip/Chip.test.jsx Outdated Show resolved Hide resolved
src/Chip/Chip.test.jsx Outdated Show resolved Hide resolved
src/Collapsible/Collapsible.test.jsx Outdated Show resolved Hide resolved
src/Collapsible/Collapsible.test.jsx Outdated Show resolved Hide resolved
src/DataTable/tests/FilterStatus.test.jsx Outdated Show resolved Hide resolved
src/DataTable/tests/TableCell.test.jsx Outdated Show resolved Hide resolved
src/DataTable/tests/TableCell.test.jsx Outdated Show resolved Hide resolved
src/DataTable/tests/TableFooter.test.jsx Outdated Show resolved Hide resolved
src/DataTable/tests/TableRow.test.jsx Outdated Show resolved Hide resolved
src/DataTable/tests/TableRow.test.jsx Outdated Show resolved Hide resolved
src/ValidationMessage/ValidationMessage.test.jsx Outdated Show resolved Hide resolved
src/StatusAlert/StatusAlert.test.jsx Outdated Show resolved Hide resolved
src/SelectableBox/tests/SelectableBox.test.jsx Outdated Show resolved Hide resolved
Copy link
Contributor

@viktorrusakov viktorrusakov left a comment

Choose a reason for hiding this comment

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

@khudym Left some additional comments. I only went through third of the files for now, so expect some more comments later on 🙂

Another general comment is we can probably remove enzyme from package.json since apparently we no longer use it in the code.

src/Breadcrumb/Breadcrumb.test.jsx Outdated Show resolved Hide resolved
src/Breadcrumb/Breadcrumb.test.jsx Outdated Show resolved Hide resolved
src/Button/Button.test.jsx Outdated Show resolved Hide resolved
src/Chip/Chip.test.jsx Outdated Show resolved Hide resolved
src/Collapsible/Collapsible.test.jsx Outdated Show resolved Hide resolved
src/DataTable/selection/ControlledSelectionStatus.jsx Outdated Show resolved Hide resolved
src/DataTable/selection/tests/ControlledSelect.test.jsx Outdated Show resolved Hide resolved
src/DataTable/tests/BulkActions.test.jsx Outdated Show resolved Hide resolved
src/DataTable/tests/DataTable.test.jsx Outdated Show resolved Hide resolved
src/DataTable/tests/ExpandAll.test.jsx Outdated Show resolved Hide resolved
src/DataTable/tests/TableActions.test.jsx Outdated Show resolved Hide resolved
src/DataTable/tests/TableCell.test.jsx Outdated Show resolved Hide resolved
src/DataTable/tests/TableHeaderCell.test.jsx Outdated Show resolved Hide resolved
src/DataTable/tests/TableHeaderRow.test.jsx Outdated Show resolved Hide resolved
src/Modal/tests/ModalDialog.test.jsx Outdated Show resolved Hide resolved
src/PageBanner/PageBanner.test.jsx Outdated Show resolved Hide resolved
src/PageBanner/PageBanner.test.jsx Outdated Show resolved Hide resolved
src/PageBanner/PageBanner.test.jsx Outdated Show resolved Hide resolved
src/SelectableBox/tests/SelectableBox.test.jsx Outdated Show resolved Hide resolved
src/Annotation/Annotation.test.jsx Outdated Show resolved Hide resolved
src/Breadcrumb/Breadcrumb.test.jsx Outdated Show resolved Hide resolved
src/Button/deprecated/Button.test.jsx Outdated Show resolved Hide resolved
src/Card/tests/CardBody.test.jsx Outdated Show resolved Hide resolved
src/CheckBox/CheckBox.test.jsx Outdated Show resolved Hide resolved
src/Popover/Popover.test.jsx Outdated Show resolved Hide resolved
src/Sticky/Sticky.test.jsx Outdated Show resolved Hide resolved
src/Tabs/Tabs.test.jsx Outdated Show resolved Hide resolved
src/Tabs/deprecated/Tabs.test.jsx Outdated Show resolved Hide resolved
src/ValidationMessage/ValidationMessage.test.jsx Outdated Show resolved Hide resolved
@PKulkoRaccoonGang
Copy link
Contributor

PKulkoRaccoonGang commented Sep 6, 2023

@khudym Great job! I think I've been reviewing this forever 😄 Left minor comments, please review them.
Please add a description for the pull request

Copy link
Contributor

@PKulkoRaccoonGang PKulkoRaccoonGang left a comment

Choose a reason for hiding this comment

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

Good job!

@viktorrusakov
Copy link
Contributor

viktorrusakov commented Sep 13, 2023

@khudym Thanks for the updates! Couple of additional feedback points:

  1. Please rebase on master branch, I know the UI in this PR is a little bugged for you and might not display the conflicts but I checked it locally and there area actually a bunch of conflicts with master branch
  2. You're still using a lot of fireEvents, please consider replacing them with userEvent wherever possible as it more closely resembles user's behaviour. Here's a good read on why that is the case https://testing-library.com/docs/user-event/intro
  3. I noticed that in Modal folder we have a bunch of test files for components and we also have a tests subfolder which contains only one ModalDialog.test.jsx file for some reason. Can you please colocate all of the Modal test files in tests folder?
  4. Tests for the deprecated Dropdown component still use enzyme and are failing because we removed enzyme from the project. Please replace enzyme with react-testing-library in those tests.

@khudym khudym force-pushed the zadorozhnii/refactor-enzyme-tests branch from 8d971a1 to 6fc6386 Compare October 11, 2023 11:59
@viktorrusakov viktorrusakov merged commit c00d2c9 into openedx:master Oct 12, 2023
8 checks passed
@openedx-webhooks
Copy link

@khudym 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@edx-semantic-release
Copy link
Contributor

🎉 This PR is included in version 21.5.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@edx-semantic-release
Copy link
Contributor

🎉 This PR is included in version 22.0.0-alpha.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blended PR is managed through 2U's blended developmnt program released on @alpha released
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

Migrate tests from enzyme to react-testing-library
6 participants