Added tests for new logics

This commit is contained in:
Alejandro Celaya
2019-10-05 10:40:32 +02:00
parent 4120d09220
commit 6d996baf5d
4 changed files with 72 additions and 2 deletions

View File

@@ -165,4 +165,20 @@ describe('ShlinkApiClient', () => {
}));
});
});
describe('health', () => {
it('returns health data', async () => {
const expectedData = {
status: 'pass',
version: '1.19.0',
};
const axiosSpy = jest.fn(createAxiosMock({ data: expectedData }));
const { health } = new ShlinkApiClient(axiosSpy);
const result = await health();
expect(axiosSpy).toHaveBeenCalled();
expect(result).toEqual(expectedData);
});
});
});