Reveiw
This commit is contained in:
parent
ad7968dadd
commit
5bf8e752e7
22 changed files with 81 additions and 112 deletions
|
|
@ -21,23 +21,6 @@ describe('ApiService', () => {
|
|||
http.verify();
|
||||
});
|
||||
|
||||
it('gets health', async () => {
|
||||
const promise = service.health();
|
||||
const req = http.expectOne('/api/v1/health');
|
||||
expect(req.request.method).toBe('GET');
|
||||
req.flush({ status: 'ok' });
|
||||
await expect(promise).resolves.toEqual({ status: 'ok' });
|
||||
});
|
||||
|
||||
it('registers a token', async () => {
|
||||
const promise = service.register('token-1');
|
||||
const req = http.expectOne('/api/v1/register');
|
||||
expect(req.request.method).toBe('POST');
|
||||
expect(req.request.body).toEqual({ token: 'token-1' });
|
||||
req.flush({ user_id: 'token-1' });
|
||||
await expect(promise).resolves.toEqual({ user_id: 'token-1' });
|
||||
});
|
||||
|
||||
it('gets data with a bearer token', async () => {
|
||||
const tree: TreeDto = { pages: [] };
|
||||
const promise = service.getData('token-1');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue