This commit is contained in:
Andras Schmelczer 2026-05-31 09:39:34 +01:00
parent ad7968dadd
commit 5bf8e752e7
22 changed files with 81 additions and 112 deletions

View file

@ -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');