2022-02-28 18:00:47 +00:00
|
|
|
import { setCustomEmojis } from '../actions/customEmojis';
|
2022-05-30 22:02:08 +00:00
|
|
|
import { initialState } from './customEmojis';
|
2022-02-28 18:00:47 +00:00
|
|
|
import { mockedStore } from './mockedStore';
|
2022-05-30 22:02:08 +00:00
|
|
|
import { ICustomEmojis } from '../definitions';
|
2022-02-28 18:00:47 +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);
|
|
|
|
});
|
|
|
|
});
|