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

Migrate enzyme Matrix tests to React Testing Library #6762

Merged
merged 12 commits into from Aug 3, 2022

Conversation

b3h3m0th
Copy link
Contributor

@b3h3m0th b3h3m0th commented Aug 2, 2022

What's in this PR?

Matrix component unit test migration enzyme --> RTL

@b3h3m0th b3h3m0th marked this pull request as ready for review August 2, 2022 14:10
@alexander-schranz
Copy link
Member

alexander-schranz commented Aug 2, 2022

@b3h3m0th the error in the CI is currently unrelated to your changes. It seems like a new version of @testing-library/user-event.

testing-library/user-event#1014

At current state I think you can adopt the package.json to:

"@testing-library/user-event": "^14.2.5, <14.4.0",

Until the bug is fixed in the @testing-library/user-event library. And so you can continue with this and the other components.

@alexander-schranz alexander-schranz added the DX Affecting the end developer label Aug 2, 2022
@alexander-schranz alexander-schranz marked this pull request as draft August 2, 2022 20:47
@b3h3m0th b3h3m0th marked this pull request as ready for review August 3, 2022 05:50
@b3h3m0th
Copy link
Contributor Author

b3h3m0th commented Aug 3, 2022

@alexander-schranz Re: package.json. Should I update the package.json in the root folder as well or just the one in sulu/src/Sulu/Bunle/AdminBundle/Resources/js/package.json ?

@alexander-schranz
Copy link
Member

alexander-schranz commented Aug 3, 2022

@b3h3m0th it would have been to be added as "^14.2.5, <14.4.0" on all which did define that package, but looks like a new version with a fix was already released so we can revert it to "^14.2.5"

package.json Outdated Show resolved Hide resolved
@alexander-schranz alexander-schranz merged commit 5c4c3fa into sulu:2.4 Aug 3, 2022
niklasnatter added a commit that referenced this pull request Aug 15, 2022
* Setup @testing-library/react as replacement for enzyme (#6711)

* Fix webspace name with special characters in it (#6714)

* Migrate enzyme Badge tests to React Testing Library (#6719)

* Migrate enzyme ButtonGroup tests to React Testing Library (#6726)

* Migrate enzyme Card & CardCollection tests to React Testing Library (#6727)

* Migrate enzyme Button tests to React Testing Library (#6721)

* Migrate enzyme CharacterCounter tests to React Testing Library (#6730)

* Fix ImageMap with custom admin path (#6729)

* Migrate enzyme CirclularProgressbar tests to React Testing Library (#6733)

* Migrate enzyme Chip tests to React Testing Library (#6732)

* Migrate enzyme Checkbox & CheckboxGroup tests to React Testing Library (#6731)

* Migrate enzyme CroppedText tests to React Testing Library (#6735)

* Migrate enzyme Breadcrumb tests to React Testing Library (#6725)

* Migrate enzyme Divider tests to React Testing Library (#6736)

* Migrate enzyme DropdownButton tests to React Testing Library (#6737)

* Migrate enzyme Folder & FolderList tests to React Testing Library (#6742)

* Migrate enzyme Field, Form & Section tests to React Testing Library (#6743)

* Migrate enzyme GhostIndicator tests to React Testing Library (#6745)

* Migrate enzyme Heading tests to React Testing Library (#6747)

* Migrate enzyme Loader tests to React Testing Library (#6750)

* Migrate enzyme Masonry tests to React Testing Library (#6752)

* Migrate enzyme Menu tests to React Testing Library (#6754)

* Migrate enzyme PermissionHint tests to React Testing Library (#6755)

* Migrate enzyme Toggler tests to React Testing Library (#6756)

* Migrate enzyme Snackbar tests to React Testing Library (#6757)

* Migrate enzyme Backdrop tests to React Testing Library (#6758)

* Migrate enzyme AutoCompletePopover tests to React Testing Library  (#6713)

* Migrate enzyme Block tests to React Testing Library (#6720)

* Migrate enzyme Grid tests to React Testing Library (#6746)

* Migrate enzyme Matrix tests to React Testing Library (#6762)

* Fix code style after php-cs-fixer update (#6772)

* Fix code styl eof PhpWebspaceCollectionDumperTest

* Fix php-cs-fix

* Fix php-cs

* Migrate enzyme Email tests to React Testing Library (#6738)

* added enzyme duplicate test file

* WIP migrated tests, added snapshots

* added comment

* added icon click test

* WIP added test

* migrated redirect test

* fixed snapshots

* fixed review

* Update src/Sulu/Bundle/AdminBundle/Resources/js/components/Input/Input.js

Co-authored-by: niklasnatter <niklas.natter@gmail.com>

* Migrate enzyme Icon tests to React Testing Library (#6748)

* added duplicate enzyme test file

* WIP added icon tests

* finished test migration

* Migrate enzyme Input tests to React Testing Library (#6751)

* added duplicate enzyme test file

* migrated first tests

* migrated render tests

* WIP added partial change test

* WIP added alternative solution

* WIP adapted input change test

* added input callback test

* finally fixed input somehow

* removed enzyme duplicate test file

* added missing snapshots

* Migrate enzyme PublishIndicator tests to React Testing Library (#6759)

migrated tests

* Migrate enzyme Dialog tests to React Testing Library (#6760)

* Migrate enzyme Dialog tests to React Testing Library

* migrated dialog tests

* udpated test

* added disabled test

* adde large class test

* added loading test

* removed unused destructured variable

* added closed test

* added click callback test

* added cancel callback test

* added snackbar test

* added unknown error display test

* migrated snackbar click callback test, fixed snapshot, removed duplicate enzyme test file

* fixed dialog snapshot & updated getByText queries to regex

* Migrate enzyme TextArea tests to React Testing Library (#6766)

* Migrate enzyme TextArea tests to React Testing Library

* added snapshot tests

* migrated tests

* Migrate enzyme Phone tests to React Testing Library (#6770)

* Migrate enzyme Phone tests to React Testing Library

* added iconclick test

* added iconclick test

* migrated tests

* removed duplicate enzyme test file & fixed snapshots

* Migrate enzyme Url tests to React Testing Library (#6771)

* Migrate enzyme Url tests to React Testing Library

* migrated protocol and path init test

* migrated tests

* migrated invalid url test

* added reset undefined test

* migrated remove error on valid email change test

* migrated remove error on change field test

* migrate onchange callback protocol change test

* migrate onchange callback on path change

* added migrated tests

* migrated undefined email test

* added correct email test

* migrate test

* migrate blur test

* migrate onblur change test

* added default prop call tests

* removed duplicate enzyme test file & update snapshots

* Migrate enzyme Switch tests to React Testing Library (#6775)

* Migrate enzyme Switch tests to React Testing Library

* removed stopPropagation test

* removed duplicate enzyme test file & fixed snapshots

* Migrate enzyme SingleItemSelection tests to React Testing Library (#6776)

* migrated snapshot tests

* migrated tests, fixed snapshots, removed duplicate enzyme test file

* Migrate enzyme PasswordConfirmation tests to React Testing Library (#6778)

* Migrate enzyme PasswordConfirmation tests to React Testing Library

* migrated passwordconfirmation tests

* added snapshots

* Migrate enzyme Navigation tests to React Testing Library (#6779)

* Migrate enzyme Navigation tests to React Testing Library

* migrated navigation component unit tests

* migrated usersection enzyme tests to RTL

* updated by text queries to regex

* Migrate enzyme SegmentCounter tests to React Testing Library (#6780)

* Fix eslint errors in javascript test cases (#6782)

* Use userEvent instead of fireEvent for simulating user interactions in javascript tests (#6783)

* Update snackbar snapshot

* Update Input snapshots

* Update email snapshots

* Update checkbox snapshots

* Update phone snapshots

* Update PasswordConfirmation snapshots

* Update Block Snapshots

* Migrate missing enzyme Block tests to React Testing Library (#6786)

* Migrate enzyme Radio tests to React Testing Library (#6777)

* Migrate enzyme SingleSelect tests to React Testing Library (#6781)

* Update phpstan-baseline.neon

* Fix merge error in RadioGroup.test.js

Co-authored-by: mamazu <14860264+mamazu@users.noreply.github.com>
Co-authored-by: Behemoth <54234287+b3h3m0th@users.noreply.github.com>
Co-authored-by: Luca Colombo <luca.colombo@newvisibility.it>
Co-authored-by: Simon Ostini <simonostini@gmail.com>
Co-authored-by: Alexander Schranz <alexander@sulu.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Affecting the end developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants