After testing the components, we are now moving on to a simpler set of tests: first, reducers; and then mappings such as mapStateToProps() and mapDispatchToProps(). Why are these tests easier to write? Because in all of these cases, we are dealing with pure functions, without side effects, that produce their output based only on their inputs. We already dealt with these sort of functions earlier in this book when we did testing for Node, so now we'll make do with a short section. The only particular care we'll have is to verify that no function (for example, a reducer) attempts to modify the state, but other than that, it's simple to test all the way. In this recipe, let's look at the different kind of tests we'll need for reducers and mappings.
Germany
Slovakia
Canada
Brazil
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
United States
Great Britain
India
Spain
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
France
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Australia
Japan
Russia