Cleaned up old Attendees model. Updated tests.
This commit is contained in:
parent
64ce97c74d
commit
260e017f79
14 changed files with 90 additions and 584 deletions
|
|
@ -71,16 +71,16 @@ describe('api methods', () => {
|
|||
expect(JSON.parse(opts.body)).toEqual({ username: 'admin', password: 'pass' })
|
||||
})
|
||||
|
||||
it('attendees.list calls correct endpoint', async () => {
|
||||
const f = mockFetch({ attendees: [] })
|
||||
await api.attendees.list({ search: 'test' })
|
||||
expect(f.mock.calls[0][0]).toBe('/api/attendees?search=test')
|
||||
it('participants.list calls correct endpoint', async () => {
|
||||
const f = mockFetch({ participants: [] })
|
||||
await api.participants.list({ search: 'test' })
|
||||
expect(f.mock.calls[0][0]).toBe('/api/participants?search=test')
|
||||
})
|
||||
|
||||
it('attendees.delete uses DELETE method', async () => {
|
||||
it('participants.delete uses DELETE method', async () => {
|
||||
const f = mockFetch({}, 204)
|
||||
await api.attendees.delete(5)
|
||||
expect(f.mock.calls[0][0]).toBe('/api/attendees/5')
|
||||
await api.participants.delete(5)
|
||||
expect(f.mock.calls[0][0]).toBe('/api/participants/5')
|
||||
expect(f.mock.calls[0][1].method).toBe('DELETE')
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue