Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Test ProjectConfigurationModal component #360

Merged
merged 7 commits into from
Mar 24, 2019

Conversation

AWolf81
Copy link
Collaborator

@AWolf81 AWolf81 commented Feb 1, 2019

Related Issue:
#309

Summary:

  • Test rendering (snapshot of default & disable save button during dep. install)
  • Component logic (local state update & form handling)

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
Copy link

codecov bot commented Feb 1, 2019

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% <ø> (ø) ⬆️
...ectConfigurationModal/ProjectConfigurationModal.js 83.33% <100%> (+83.33%) ⬆️
src/components/FormField/FormField.js 31.25% <0%> (+31.25%) ⬆️
...nents/ProjectIconSelection/ProjectIconSelection.js 50% <0%> (+50%) ⬆️

projectIcon: 'icon',
};

const shallowRender = (installActive: boolean = false) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we're not having // @flow in this file, do we need to have boolean specified here?

Copy link
Collaborator

@melanieseltzer melanieseltzer left a comment

Choose a reason for hiding this comment

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

👍

@melanieseltzer melanieseltzer merged commit 189d2e8 into master Mar 24, 2019
@melanieseltzer melanieseltzer deleted the test-project-configuration-modal branch March 24, 2019 17:58
Haroenv pushed a commit that referenced this pull request Mar 27, 2019
* WIP: Added render test

* WIP: Added tests

* fixed flow

* added focus test

* Merge branch 'master' into test-project-configuration-modal

* fixed linting warnings

* removed typing as no flow used in test files
Haroenv added a commit that referenced this pull request Mar 27, 2019
* add analytics tags

* Update AddDependencySearchProvider.js

* #352 Disable actions that require an internet connection (#368)

* Online check component added

* add reducer & action for online check component.

also included in App.js

* removed sidebar functionality when offline

* removed depedency functionality when offline

* removed functionality from create new project wizard when offline

* fixed tests to align with disabled pattern

* add infoBanner to Z-indexes for future usage.

* removed random {' '}, changed IS_ONLINE_CHECK to SET_ONLINE_STATUS

* pull request requested changes

missed one file.

* updated infobar to be fixed header.

* flow fix

* remove random whitespace

* Pull request changes

remove state type, move styled components to before redux part, change background color of infobar to be transparent.

* enable menu items based on isOnline

* Setup ESlint rules for Jest (#366)

* WIP: Added eslint-jest & fixed issues (except snapshots)

* reduced snapshot size to meet max 100 lines

* fixed snapshot

* changed comment to a note about noPadding prop

* updated snapshot

* Test ProjectConfigurationModal component (#360)

* WIP: Added render test

* WIP: Added tests

* fixed flow

* added focus test

* Merge branch 'master' into test-project-configuration-modal

* fixed linting warnings

* removed typing as no flow used in test files

* Test CreateNewProjectWizard components (#361)

* WIP: Added tests

* WIP: ProjectType undefined not throwing in test

* fixed flow

* added tests

* reverted to children render props

* Merge branch 'master' into test-create-new-project-wiz

* Fixed linting & replaced snapshot with simple smoke tests

* addressed review comments

* Test DependencyManagementPane component (#363)

* moved related components to DependencyManagementPane

* added tests

* fixed flow

* added a constant instead of Date.now()

* updated snapshot

* removed white-spaces

* removed verbose

* fixed linting & mocked AlgoliaLogo

* move related component files & moved tests to __tests__ folder

* Add script for test:dev

* Fix spaces and update lint-staged (#369)

* Switch to advanced config to silence validation warning

* Fix spacing issues

* chore: fix merge changes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants