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 welcome page and recommendations tests to RTL #1116

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

attiyaIshaque
Copy link
Contributor

@attiyaIshaque attiyaIshaque commented Dec 14, 2023

Description

This task involves migrating our existing tests for the 'Welcome Page' and 'Recommendations' functionalities from Enzyme to React Testing Library (RTL).

JIRA

VAN-1772

Copy link

codecov bot commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (dae050e) 87.11% compared to head (7e3729a) 87.11%.

❗ Current head 7e3729a differs from pull request most recent head 37ec14b. Consider uploading reports for the commit 37ec14b to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1116   +/-   ##
=======================================
  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 marked this pull request as ready for review December 14, 2023 14:00
@attiyaIshaque attiyaIshaque requested a review from a team as a code owner December 14, 2023 14:00

expect(progressiveProfilingPage.find('a.pgn__hyperlink').text()).toEqual('Learn more about how we use this information.');
const infoMessage = 'Learn more about how we use this information.';
const findByTextWithClass = (container, text, className) => Array.from(container.querySelectorAll(`.${className}`)).find(
Copy link
Contributor

Choose a reason for hiding this comment

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

why can't we directly find by text?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we can use it like this. Sure i will change it.

const { getByText } =  render(reduxWrapper(<IntlProgressiveProfilingPage />));

  const learnMoreButton = getByText('Learn more about how we use this information.');

  expect(learnMoreButton).toBeDefined();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@syedsajjadkazmii I have changed it.

@attiyaIshaque attiyaIshaque merged commit 924488c into master Dec 19, 2023
5 checks passed
@attiyaIshaque attiyaIshaque deleted the attiya/VAN-1772-RTL-tests branch December 19, 2023 10:57
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