Extended ShlinkApiClient test covering editDomainRedirects

This commit is contained in:
Alejandro Celaya 2021-08-22 09:11:14 +02:00
parent dce1cefd49
commit d88f822125

View file

@ -297,4 +297,17 @@ describe('ShlinkApiClient', () => {
expect(result).toEqual(expectedData);
});
});
describe('editDomainRedirects', () => {
it('returns the redirects', async () => {
const resp = { baseUrlRedirect: null, regular404Redirect: 'foo', invalidShortUrlRedirect: 'bar' };
const axiosSpy = createAxiosMock({ data: resp });
const { editDomainRedirects } = new ShlinkApiClient(axiosSpy, '', '');
const result = await editDomainRedirects({ domain: 'foo' });
expect(axiosSpy).toHaveBeenCalled();
expect(result).toEqual(resp);
});
});
});