2022-01-13 20:22:57 +00:00
|
|
|
import { setCustomEmojis } from '../actions/customEmojis';
|
2022-05-07 01:06:08 +00:00
|
|
|
import { initialState } from './customEmojis';
|
2022-01-13 20:22:57 +00:00
|
|
|
import { mockedStore } from './mockedStore';
|
2022-05-07 01:06:08 +00:00
|
|
|
import { ICustomEmojis } from '../definitions';
|
2022-01-13 20:22:57 +00:00
|
|
|
|
|
|
|
describe('test reducer', () => {
|
|
|
|
it('should return initial state', () => {
|
|
|
|
const state = mockedStore.getState().customEmojis;
|
|
|
|
expect(state).toEqual(initialState);
|
|
|
|
});
|
|
|
|
it('should return modified store after action', () => {
|
|
|
|
const emojis: ICustomEmojis = { dog: { name: 'dog', extension: 'jpg' }, cat: { name: 'cat', extension: 'jpg' } };
|
|
|
|
mockedStore.dispatch(setCustomEmojis(emojis));
|
|
|
|
const state = mockedStore.getState().customEmojis;
|
|
|
|
expect(state).toEqual(emojis);
|
|
|
|
});
|
|
|
|
});
|