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

@@ -66,9 +66,9 @@ describe('shortUrlVisitsReducer', () => {
});
it.each([
[{ shortCode: 'abc123' }, [ ...visitsMocks, {}]],
[{ shortCode: 'abc123' }, [{}, ...visitsMocks ]],
[{ shortCode: 'def456' }, visitsMocks ],
])('appends a new visit on CREATE_VISIT', (state, expectedVisits) => {
])('prepends new visits on CREATE_VISIT', (state, expectedVisits) => {
const shortUrl = {
shortCode: 'abc123',
};