bigbuffet-rw/app/soapbox/reducers/__tests__/identity_proofs-test.js

33 lines
921 B
JavaScript
Raw Normal View History

2020-06-09 18:08:07 -07:00
import { Map as ImmutableMap } from 'immutable';
2020-07-08 20:05:22 -07:00
import * as actions from 'soapbox/actions/identity_proofs';
2022-01-10 14:01:24 -08:00
import reducer from '../identity_proofs';
2020-06-09 18:08:07 -07:00
describe('identity_proofs reducer', () => {
it('should return the initial state', () => {
expect(reducer(undefined, {})).toEqual(ImmutableMap());
});
2020-07-08 20:05:22 -07:00
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,
});
});
2020-06-09 18:08:07 -07:00
});