Refactor of redux tests to avoid covering RTK implementation details

This commit is contained in:
Alejandro Celaya
2023-03-18 12:35:33 +01:00
parent 9cefdb7977
commit 4e8e16f16d
21 changed files with 222 additions and 730 deletions

View File

@@ -9,10 +9,8 @@ describe('visitCreationReducer', () => {
const visit = Mock.all<Visit>();
it('just returns the action with proper type', () => {
expect(createNewVisits([{ shortUrl, visit }])).toEqual({
type: createNewVisits.toString(),
payload: { createdVisits: [{ shortUrl, visit }] },
});
const { payload } = createNewVisits([{ shortUrl, visit }]);
expect(payload).toEqual({ createdVisits: [{ shortUrl, visit }] });
});
});
});