@@ -77,6 +77,7 @@ function onCreateResponse(state, { route, pendingId, err, response }) {
if (err) {
const newRoute = {
...(state[route] || {}),
+ loading: false,
error: true
};
@@ -111,6 +111,7 @@ describe('CRUD reducer', () => {
const result = crud(state, action);
expect(result[route].items).to.have.length(0);
+ expect(result[route]).to.have.property('loading', false);
expect(result[route]).to.have.property('error', true);
});