Properly test 106

I had the wrong test setup for the "expected-to-be-green" side tests
(for debugging).
This commit is contained in:
Robert Schäfer 2019-01-17 15:29:47 +01:00
parent d50015af3c
commit cd3f0955f9

View File

@ -32,7 +32,12 @@ describe('authorization', () => {
describe('not logged in', async () => {
it('does not expose the owner\'s email address', async () => {
expect(await action(headers)).toEqual({ User: [ { email: null } ] })
try {
await action(headers)
} catch (error) {
expect(error.response.errors[0].message).toEqual('Not Authorised!')
expect(error.response.data).toEqual({ User: [ { email: null } ] })
}
})
})
@ -52,7 +57,12 @@ describe('authorization', () => {
email: 'someone@example.org',
password: 'else'
})
expect(await action(headers)).toEqual({ User: [ { email: null } ] })
try {
await action(headers)
} catch (error) {
expect(error.response.errors[0].message).toEqual('Not Authorised!')
expect(error.response.data).toEqual({ User: [ { email: null } ] })
}
})
})
})