mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-21 05:56:20 +00:00
Created mercure info reducer and loaded info when server is reachable
This commit is contained in:
@@ -209,4 +209,20 @@ describe('ShlinkApiClient', () => {
|
||||
expect(result).toEqual(expectedData);
|
||||
});
|
||||
});
|
||||
|
||||
describe('mercureInfo', () => {
|
||||
it('returns mercure info', async () => {
|
||||
const expectedData = {
|
||||
token: 'abc.123.def',
|
||||
mercureHubUrl: 'http://example.com/.well-known/mercure',
|
||||
};
|
||||
const axiosSpy = jest.fn(createAxiosMock({ data: expectedData }));
|
||||
const { mercureInfo } = new ShlinkApiClient(axiosSpy);
|
||||
|
||||
const result = await mercureInfo();
|
||||
|
||||
expect(axiosSpy).toHaveBeenCalled();
|
||||
expect(result).toEqual(expectedData);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user