May 2019
Intermediate to advanced
496 pages
10h 38m
English
The saga should perform all the same work as our existing doSave. That's what we'll build out in this section:
it('submits request to the fetch api', async () => { const inputCustomer = { firstName: 'Ashley' }; dispatchRequest(inputCustomer); expect(window.fetch).toHaveBeenCalledWith('/customers', { body: JSON.stringify(inputCustomer), method: 'POST', credentials: 'same-origin', headers: { 'Content-Type': 'application/json' } });});
Read now
Unlock full access