Ensured new visits are prepended and not appended, ensuring they keep the proper order

This commit is contained in:
Alejandro Celaya
2021-05-01 16:39:13 +02:00
parent e44527e9c9
commit 66deba29f5
7 changed files with 15 additions and 15 deletions

View File

@@ -64,7 +64,7 @@ describe('orphanVisitsReducer', () => {
expect(visits).toEqual(actionVisits);
});
it('appends a new visits on CREATE_VISIT', () => {
it('prepends new visits on CREATE_VISIT', () => {
const prevState = buildState({ visits: visitsMocks });
const { visits } = reducer(
@@ -72,7 +72,7 @@ describe('orphanVisitsReducer', () => {
{ type: CREATE_VISITS, createdVisits: [{ visit: {} }, { visit: {} }] } as any,
);
expect(visits).toEqual([ ...visitsMocks, {}, {}]);
expect(visits).toEqual([{}, {}, ...visitsMocks ]);
});
it('returns new progress on GET_ORPHAN_VISITS_PROGRESS_CHANGED', () => {