Refactored user/volunteer/participant identity.
This commit is contained in:
parent
e640bf8bed
commit
1eb6a99ff6
28 changed files with 469 additions and 265 deletions
|
|
@ -64,11 +64,11 @@ describe('apiJSON', () => {
|
|||
describe('api methods', () => {
|
||||
it('login calls correct endpoint', async () => {
|
||||
const f = mockFetch({ token: 'tok', user: { id: 1 } })
|
||||
await api.login('admin', 'pass')
|
||||
await api.login('admin@example.com', 'pass')
|
||||
const [url, opts] = f.mock.calls[0]
|
||||
expect(url).toBe('/api/login')
|
||||
expect(opts.method).toBe('POST')
|
||||
expect(JSON.parse(opts.body)).toEqual({ username: 'admin', password: 'pass' })
|
||||
expect(JSON.parse(opts.body)).toEqual({ email: 'admin@example.com', password: 'pass' })
|
||||
})
|
||||
|
||||
it('participants.list calls correct endpoint', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue