mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 08:19:07 +00:00
Addition to hook test
This commit is contained in:
parent
a39f8fad2b
commit
5e0730b08d
@ -27,4 +27,17 @@ describe('useLicenseLimits', () => {
|
||||
expect(useQuery).toHaveBeenCalledWith(['ee', 'license-limit-info'], expect.any(Function));
|
||||
expect(result.current.license.data).toEqual(data.data);
|
||||
});
|
||||
|
||||
it('data should be undefined if there is an API error', async () => {
|
||||
// const data = { data: { id: 1, name: 'Test License' } };
|
||||
useQuery.mockReturnValue({
|
||||
isError: true,
|
||||
});
|
||||
|
||||
const { result } = renderHook(() => useLicenseLimits());
|
||||
|
||||
expect(useFetchClient).toHaveBeenCalled();
|
||||
expect(useQuery).toHaveBeenCalledWith(['ee', 'license-limit-info'], expect.any(Function));
|
||||
expect(result.current.license.data).toEqual(undefined);
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user