bigbuffet-rw/app/soapbox/reducers/__tests__/identity_proofs-test.js
2020-07-08 22:05:22 -05:00

30 lines
919 B
JavaScript

import reducer from '../identity_proofs';
import { Map as ImmutableMap } from 'immutable';
import * as actions from 'soapbox/actions/identity_proofs';
describe('identity_proofs reducer', () => {
it('should return the initial state', () => {
expect(reducer(undefined, {})).toEqual(ImmutableMap());
});
it('should handle IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST', () => {
const state = ImmutableMap({ isLoading: false });
const action = {
type: actions.IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST,
};
expect(reducer(state, action).toJS()).toMatchObject({
isLoading: true,
});
});
it('should handle IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL', () => {
const state = ImmutableMap({ isLoading: true });
const action = {
type: actions.IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL,
};
expect(reducer(state, action).toJS()).toMatchObject({
isLoading: false,
});
});
});