joshwcomeau / guppy

🐠A friendly application manager and task runner for React.js
ISC License
3.27k stars 154 forks source link

Test ProjectPage component #357

Closed AWolf81 closed 5 years ago

AWolf81 commented 5 years ago

Related Issue:

309

Summary: Added test for ProjectPage component with

There is one flow issue that I'm not sure how to fix (see screenshot below) - disabled flow for that file. It's telling unexpected token : in fileTransform.js. I think babel-jest is not properly loading that file.

During testing I've noticed that I need to handle .gif import because with-out this DependencyInstalling.js fails with an error for the imported gif image (see change in package.json). Not sure if there is a better way to mock this but it is working.

Just mapStateToProps is not tested as I think it's not required. Or is it needed? I think it's OK to keep the coverage lower here and not test it as it would add maintanance if we would ever change the props of the component.

Screenshots/GIFs: grafik Flow error in fileTransform.js (if flow enabled for that file)

codecov[bot] commented 5 years ago

Codecov Report

Merging #357 into master will increase coverage by 5.01%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #357      +/-   ##
==========================================
+ Coverage   32.32%   37.33%   +5.01%     
==========================================
  Files         159      157       -2     
  Lines        3706     3495     -211     
  Branches      430      440      +10     
==========================================
+ Hits         1198     1305     +107     
+ Misses       2238     1911     -327     
- Partials      270      279       +9
Impacted Files Coverage Δ
src/components/ProjectPage/ProjectPage.js 88.46% <ø> (+88.46%) :arrow_up:
...dencySearchProvider/AddDependencySearchProvider.js 0% <0%> (ø) :arrow_up:
src/components/FadeOnChange/FadeOnChange.js 0% <0%> (ø) :arrow_up:
src/components/MountAfter/MountAfter.js 0% <0%> (ø) :arrow_up:
src/components/Label/Label.js
...omponents/MainContentWrapper/MainContentWrapper.js
src/components/SettingsButton/SettingsButton.js 11.11% <0%> (+11.11%) :arrow_up:
...s/DeleteDependencyButton/DeleteDependencyButton.js 20% <0%> (+20%) :arrow_up:
src/components/CustomHighlight/CustomHighlight.js 20% <0%> (+20%) :arrow_up:
...pendencyManagementPane/DependencyManagementPane.js 21.95% <0%> (+21.95%) :arrow_up:
... and 17 more