Improved how tags are exposed by the ApiClient when listing tags

This commit is contained in:
Alejandro Celaya
2020-05-10 11:20:40 +02:00
parent 67c674f073
commit 6fd30ed51a
4 changed files with 6 additions and 5 deletions

View File

@@ -103,7 +103,7 @@ describe('tagsListReducer', () => {
it('dispatches loaded lists when no error occurs', async () => {
const tags = [ 'foo', 'bar', 'baz' ];
listTagsMock.mockResolvedValue({ data: tags, stats: [] });
listTagsMock.mockResolvedValue({ tags, stats: [] });
buildShlinkApiClient.mockReturnValue({ listTags: listTagsMock });
await listTags(buildShlinkApiClient, true)()(dispatch, getState);

View File

@@ -141,7 +141,7 @@ describe('ShlinkApiClient', () => {
const result = await listTags();
expect({ data: expectedTags }).toEqual(result);
expect({ tags: expectedTags }).toEqual(result);
expect(axiosSpy).toHaveBeenCalledWith(expect.objectContaining({ url: '/tags', method: 'GET' }));
});
});