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

Aaron/react 18 #729

Merged
merged 7 commits into from
Jul 27, 2023
Merged

Aaron/react 18 #729

merged 7 commits into from
Jul 27, 2023

Conversation

aaronchongth
Copy link
Member

@aaronchongth aaronchongth commented Jul 26, 2023

What's new

This is used for testing the migration and implementing suggestions while testing.

  • removed deprecated react-components/lib/commands and react-components/lib/reports
  • added mention of react-testing-library issue that requires a workaround
  • reverted test changes to stack navigator
  • minor refactor

Self-checks

  • I have prototyped this new feature (if necessary) on Figma
  • I'm familiar with and follow this Typescript guideline
  • I added unit-tests for new components
  • I tried testing edge cases
  • I tested the behavior of the components that interact with the backend, with an e2e test

Discussion

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #729 (b77f4d8) into cr/react-18 (178f6d1) will decrease coverage by 4.62%.
The diff coverage is 100.00%.

@@               Coverage Diff               @@
##           cr/react-18     #729      +/-   ##
===============================================
- Coverage        38.05%   33.44%   -4.62%     
===============================================
  Files              165      131      -34     
  Lines             4223     3657     -566     
  Branches           938      833     -105     
===============================================
- Hits              1607     1223     -384     
+ Misses            2418     2296     -122     
+ Partials           198      138      -60     
Flag Coverage Δ
dashboard 18.60% <100.00%> (ø)
react-components 52.00% <ø> (-4.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
packages/dashboard/src/components/appbar.tsx 32.19% <100.00%> (ø)

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
…e are testing

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
@aaronchongth aaronchongth marked this pull request as ready for review July 26, 2023 10:12
@aaronchongth aaronchongth mentioned this pull request Jul 26, 2023
5 tasks
Copy link
Collaborator

@Angatupyry Angatupyry left a comment

Choose a reason for hiding this comment

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

LGTM!
Thanks for taking the time to do this!

@aaronchongth aaronchongth merged commit 8e62a77 into cr/react-18 Jul 27, 2023
4 checks passed
@aaronchongth aaronchongth deleted the aaron/react-18 branch July 27, 2023 01:45
aaronchongth added a commit that referenced this pull request Jul 27, 2023
* Update to 18 rmf auth

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Update to react router v6

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Update to 18 rmf component

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Add prop to render children

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Update to 18 dashboard

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Update lock file

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Porting to react 18

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Add pathname harcode to render tab name correctly

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Adding * to render nested routes

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Remove close tag

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Remove testing console

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Adding nested routes

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Remove useMatch and pass only username to render child route properly

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Drawing routes according to react router v6

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Removing unused import

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Render user profile by username

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Update react testing library

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Updating react testing library package and use fireevent instead of userEvent

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Use fireevent instead of userEvent

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Use fireevent instead of userEvent

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Update test according to react 18

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Remove userEvent and use fireevent instad

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Add describe to wrap testing and use fire event instead of userevent

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* FireEvent instead of userEvent

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Wrap test into describe

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Wrap test into describe

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Add fireevent instead of userevent.

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* FireEvent added and waitFor expect

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Remove unnecessary function to render component

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Remove test comment

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Using testing library renderHook

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Update react testing library

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Adding function to avoid warning act(...)

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Fix test according to the new version of testing library

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Adding beforeAll code test to silence warning

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Comment test failed

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Create a use stack navigator test acording to new version of testing library

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Add comment to explain change

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* main admin path Navigate to users

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Improve function to be more easy to read

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Fix test in log table report and useasync function

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Remove unused import

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Aaron/react 18 (#729)

* Adding link to unresolved issue to testing

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Added back missing test

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Reverting stack navigator tests

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Remove the rest of reporting components from react-components

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Remove deprecated command forms

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Revert to remove expectation of loading text since that is not what we are testing

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Add DashboardRoute to the route map since it returns undefined anyway

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

---------

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

---------

Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Co-authored-by: Aaron Chong <aaronchongth@gmail.com>
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