This commit is contained in:
Robert Schäfer 2018-12-19 18:12:10 +01:00
parent 16997ee63d
commit b320ef30fc

View File

@ -134,16 +134,19 @@ describe('actions', () => {
}) })
it('populates error messages', async () => { it('populates error messages', async () => {
expect(action({ commit }, { email: 'user@example.org', password: 'wrong' })) expect(
.rejects action({ commit }, { email: 'user@example.org', password: 'wrong' })
.toThrowError('This error is expected.') ).rejects.toThrowError('This error is expected.')
expect(mutate).toHaveBeenCalled() expect(mutate).toHaveBeenCalled()
expect(onLogin).not.toHaveBeenCalled() expect(onLogin).not.toHaveBeenCalled()
}) })
it('saves pending flags in order', async () => { it('saves pending flags in order', async () => {
try { try {
await action({ commit }, { email: 'user@example.org', password: 'wrong' }) await action(
{ commit },
{ email: 'user@example.org', password: 'wrong' }
)
} catch (err) {} // ignore } catch (err) {} // ignore
expect(commit.mock.calls).toEqual( expect(commit.mock.calls).toEqual(
expect.arrayContaining([ expect.arrayContaining([