mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-25 07:56:28 +00:00
Added tests for new logics
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user