May 2019
Intermediate to advanced
496 pages
10h 38m
English
Now that we are setting up the query string correctly, we need to get the data back out of it. We can do that by defining a new component called CustomerSearchRoute, which has the single responsibility of converting the query string to props that are then passed to CustomerSearch:
import React from 'react';import { createShallowRenderer, type } from './shallowHelpers';import { CustomerSearchRoute } from '../src/CustomerSearchRoute';import { CustomerSearch } from '../src/CustomerSearch/CustomerSearch';describe('CustomerSearchRoute', () => { let render, elementMatching; beforeEach(() => { ({ render, elementMatching } = createShallowRenderer()); }); it('parses searchTerm from query ...Read now
Unlock full access