joshwcomeau / guppy

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

Test ProjectConfigurationModal component #360

Closed AWolf81 closed 5 years ago

AWolf81 commented 5 years ago

Related Issue:

309

Summary:

Coverage is OK but still wondering how we should test mapStateToProps and mapDispatchToProps. Here is a post about it.

I don't want to add a mock store to test dispatching - I like the simplicity of directly testing everything with component props. For mapStateToProps I'd prefer to export mapStateToProps as it's pretty easy todo but as mentioned in the post it's not good to expose private variables only for testing.

@idoberko2 any ideas how we should add mapStateToProps test?

codecov[bot] commented 5 years ago

Codecov Report

Merging #360 into master will increase coverage by 1.29%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #360      +/-   ##
==========================================
+ Coverage   37.54%   38.83%   +1.29%     
==========================================
  Files         158      158              
  Lines        3540     3512      -28     
  Branches      449      449              
==========================================
+ Hits         1329     1364      +35     
+ Misses       1928     1868      -60     
+ Partials      283      280       -3
Impacted Files Coverage Δ
src/components/Sidebar/Sidebar.js 100% <ø> (ø) :arrow_up:
...ectConfigurationModal/ProjectConfigurationModal.js 83.33% <100%> (+83.33%) :arrow_up:
src/components/FormField/FormField.js 31.25% <0%> (+31.25%) :arrow_up:
...nents/ProjectIconSelection/ProjectIconSelection.js 50% <0%> (+50%) :arrow_up: