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

Fix: Upgrade to react 18 #159

Merged
merged 15 commits into from
May 31, 2022
Merged

Fix: Upgrade to react 18 #159

merged 15 commits into from
May 31, 2022

Conversation

shaharyar123
Copy link
Contributor

@shaharyar123 shaharyar123 commented Apr 27, 2022

Summary

  1. Updates React SDK to use React 18 and fixed related typescript issues.
  2. Replaces enzyme with react testing library to make unit tests work with React 18.

Test Plan

  • Updated many unit tests to use React Testing Library instead of Enzyme.
  • E2E Tests also Pass.

Copy link
Contributor

@zashraf1985 zashraf1985 left a comment

Choose a reason for hiding this comment

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

Looks Great! Just two minor change requests

@@ -45,5 +45,5 @@ jobs:
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }}
EVENT_MESSAGE: ${{ github.event.message }}
HOME: 'home/runner'
run: |
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like an unnecessary change. can you re add the space here so that it does not appear in the PR diff

<OptimizelyProvider optimizely={optimizelyMock}>
<MyExperimentComponent options={{ timeout: mockDelay }} />
</OptimizelyProvider>
);
expect(component.text()).toBe('null|false|false'); // initial render
await waitFor(() => expect(screen.getByTestId('result')).toHaveTextContent('null|false|false'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the // initial render comment here again

@zashraf1985
Copy link
Contributor

@opti-jnguyen Can you take a look when you get some time.

Copy link
Contributor

@zashraf1985 zashraf1985 left a comment

Choose a reason for hiding this comment

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

LGTM! Great work @shaharyar123

Copy link
Contributor

@opti-jnguyen opti-jnguyen left a comment

Choose a reason for hiding this comment

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

Seems fine when testing locally - LGTM!

@zashraf1985 zashraf1985 merged commit 13c8626 into master May 31, 2022
@zashraf1985 zashraf1985 deleted the sherry/react-version-update branch May 31, 2022 18:00
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.

4 participants