mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-14 19:43:49 +00:00
Migrated visits-loading actions to payload actions
This commit is contained in:
@@ -59,10 +59,10 @@ describe('orphanVisitsReducer', () => {
|
||||
|
||||
it('return visits on GET_ORPHAN_VISITS', () => {
|
||||
const actionVisits = [{}, {}];
|
||||
const state = reducer(
|
||||
buildState({ loading: true, error: false }),
|
||||
{ type: GET_ORPHAN_VISITS, visits: actionVisits } as any,
|
||||
);
|
||||
const state = reducer(buildState({ loading: true, error: false }), {
|
||||
type: GET_ORPHAN_VISITS,
|
||||
payload: { visits: actionVisits },
|
||||
} as any);
|
||||
const { loading, error, visits } = state;
|
||||
|
||||
expect(loading).toEqual(false);
|
||||
@@ -173,7 +173,10 @@ describe('orphanVisitsReducer', () => {
|
||||
|
||||
expect(dispatchMock).toHaveBeenCalledTimes(2);
|
||||
expect(dispatchMock).toHaveBeenNthCalledWith(1, { type: GET_ORPHAN_VISITS_START });
|
||||
expect(dispatchMock).toHaveBeenNthCalledWith(2, { type: GET_ORPHAN_VISITS, visits, query: query ?? {} });
|
||||
expect(dispatchMock).toHaveBeenNthCalledWith(2, {
|
||||
type: GET_ORPHAN_VISITS,
|
||||
payload: { visits, query: query ?? {} },
|
||||
});
|
||||
expect(ShlinkApiClient.getOrphanVisits).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user