import { createOvermindMock } from 'overmind'
import { config } from './'
describe('Actions', () => {
describe('getPost', () => {
test('should get post with passed id', async () => {
const overmind = createOvermindMock(config, {
await overmind.actions.getPost('1')
expect(overmind.state).toEqual({
currentPost: { id: '1' },
test('should handle errors', async () => {
const overmind = createOvermindMock(config, {
await overmind.actions.getPost('1')
expect(overmind.state.isLoadingPost).toBe(false)
expect(overmind.state.error.message).toBe('test')