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: Migrate Registration tests to RTL #1122

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

attiyaIshaque
Copy link
Contributor

@attiyaIshaque attiyaIshaque commented Jan 1, 2024

Description

Migrate existing tests for the 'Registration' functionality from Enzyme to React Testing Library (RTL).

JIRA

VAN-1769

How Has This Been Tested?

Locally

Copy link

codecov bot commented Jan 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (10a10c8) 87.11% compared to head (5d33116) 87.11%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1122   +/-   ##
=======================================
  Coverage   87.11%   87.11%           
=======================================
  Files         124      124           
  Lines        2282     2282           
  Branches      637      637           
=======================================
  Hits         1988     1988           
  Misses        285      285           
  Partials        9        9           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@attiyaIshaque attiyaIshaque force-pushed the attiya/VAN-1769-RTL-tests branch 3 times, most recently from a68fc41 to 1fdaad0 Compare January 2, 2024 12:16
@attiyaIshaque attiyaIshaque marked this pull request as ready for review January 3, 2024 10:56
@attiyaIshaque attiyaIshaque requested a review from a team as a code owner January 3, 2024 10:56
target: { value: '', name: 'country' },
relatedTarget: { type: 'button', className: 'btn-icon pgn__form-autosuggest__icon-button' },
Copy link
Contributor

Choose a reason for hiding this comment

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

is it working ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes its working fine.

const { container } = render(routerWrapper(reduxWrapper(<IntlCountryField {...props} />)));
const countryInput = container.querySelector('input[name="country"]');

fireEvent.focus(countryInput);
Copy link
Contributor

Choose a reason for hiding this comment

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

In one of test case focus was not working because it behaves async so we need to put in 'act' just want to confirm that is it working fine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup. working perfectly without getting a console error.

const { container } = render(routerWrapper(reduxWrapper(<IntlEmailField {...props} />)));

const emailInput = container.querySelector('input#email');
fireEvent.focus(emailInput, { target: { value: '', name: 'email' } });
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

@attiyaIshaque attiyaIshaque merged commit db3655c into master Jan 4, 2024
7 checks passed
@attiyaIshaque attiyaIshaque deleted the attiya/VAN-1769-RTL-tests branch January 4, 2024 09:33
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