Now we want to test a component with events. For this, the <CountrySelect> component will come in handy, because it can process some events, and it will call some callbacks accordingly.
First of all, let's see the initial setup, including a list of countries that we'll be using for different tests:
// Source file: src/regionsApp/countrySelect.test.js/* @flow */import React from "react";import Enzyme from "enzyme";import Adapter from "enzyme-adapter-react-16";import { CountrySelect } from "./countrySelect.component";Enzyme.configure({ adapter: new Adapter() });const threeCountries = [ { countryCode: "UY", countryName: "Uruguay" }, { countryCode: "AR", countryName: "Argentina" }, { countryCode: "BR", countryName: ...