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

refactor: depreciate enzyme #1128

Merged
merged 1 commit into from
Jan 17, 2024
Merged

refactor: depreciate enzyme #1128

merged 1 commit into from
Jan 17, 2024

Conversation

mubbsharanwar
Copy link
Contributor

move unit tests from enzyme to RTL.

VAN-1792

@mubbsharanwar mubbsharanwar requested a review from a team as a code owner January 16, 2024 05:28
Copy link

codecov bot commented Jan 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b9b4492) 87.12% compared to head (69c7742) 87.04%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1128      +/-   ##
==========================================
- Coverage   87.12%   87.04%   -0.09%     
==========================================
  Files         124      124              
  Lines        2284     2284              
  Branches      638      638              
==========================================
- Hits         1990     1988       -2     
- Misses        285      287       +2     
  Partials        9        9              

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

expect(field.type()).toEqual('select');
expect(fieldRenderer.find('label').text()).toEqual('Year of Birth');
expect(value).toEqual(1997);
expect(input.type).toEqual('select-one');
Copy link
Contributor

Choose a reason for hiding this comment

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

why has it changed to select-one instead of select?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should be select, but the element was giving the type select-one, although I tried to debug the element and found the input type was select

expect(value).toEqual(1997);
expect(input.type).toEqual('select-one');
expect(label.textContent).toContain(fieldData.label);
expect(value).toEqual('1997');
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, why does RTL expect the value to be a string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In our component, the value was set in integer, but in the unit test in changeHandler function, the value was getting in string.

move unit test from enzyme to RTL

VAN-1792
@mubbsharanwar mubbsharanwar merged commit 2ea9301 into master Jan 17, 2024
6 of 7 checks passed
@mubbsharanwar mubbsharanwar deleted the VAN-1792 branch January 17, 2024 07:37
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