edit conversations-test
This commit is contained in:
parent
c55e937dcc
commit
acfd8fe2ac
|
@ -1,5 +1,6 @@
|
||||||
import reducer from '../conversations';
|
import reducer from '../conversations';
|
||||||
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
|
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
|
||||||
|
import * as actions from 'soapbox/actions/conversations';
|
||||||
|
|
||||||
describe('conversations reducer', () => {
|
describe('conversations reducer', () => {
|
||||||
it('should return the initial state', () => {
|
it('should return the initial state', () => {
|
||||||
|
@ -10,4 +11,55 @@ describe('conversations reducer', () => {
|
||||||
mounted: false,
|
mounted: false,
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should handle CONVERSATIONS_FETCH_REQUEST', () => {
|
||||||
|
const state = ImmutableMap({ isLoading: false });
|
||||||
|
const action = {
|
||||||
|
type: actions.CONVERSATIONS_FETCH_REQUEST,
|
||||||
|
};
|
||||||
|
expect(reducer(state, action).toJS()).toMatchObject({
|
||||||
|
isLoading: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle CONVERSATIONS_FETCH_FAIL', () => {
|
||||||
|
const state = ImmutableMap({ isLoading: true });
|
||||||
|
const action = {
|
||||||
|
type: actions.CONVERSATIONS_FETCH_FAIL,
|
||||||
|
};
|
||||||
|
expect(reducer(state, action).toJS()).toMatchObject({
|
||||||
|
isLoading: false,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// it('should handle the Action CONVERSATIONS_MOUNT', () => {
|
||||||
|
// expect(
|
||||||
|
// reducer(
|
||||||
|
// {
|
||||||
|
// mounted: false,
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: 'CONVERSATIONS_MOUNT',
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ).toEqual({
|
||||||
|
// mounted: true,
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// it('should handle the Action CONVERSATIONS_UNMOUNT', () => {
|
||||||
|
// expect(
|
||||||
|
// reducer(
|
||||||
|
// {
|
||||||
|
// mounted: true,
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: 'CONVERSATIONS_UNMOUNT',
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ).toEqual({
|
||||||
|
// mounted: false,
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue