mirror of
https://github.com/strapi/strapi.git
synced 2025-08-08 08:46:42 +00:00
useFolderStructure: Fix tests
This commit is contained in:
parent
d413735a6b
commit
d26bc90fb2
@ -61,15 +61,17 @@ describe('useFolderStructure', () => {
|
||||
});
|
||||
|
||||
test('fetches data from the right URL', async () => {
|
||||
await setup();
|
||||
const { waitForNextUpdate } = await setup();
|
||||
|
||||
await waitForNextUpdate();
|
||||
|
||||
expect(axiosInstance.get).toBeCalledWith('/upload/folder-structure');
|
||||
});
|
||||
|
||||
test('transforms the required object keys', async () => {
|
||||
const { result, waitFor } = await setup({});
|
||||
const { result, waitForNextUpdate } = await setup({});
|
||||
|
||||
await waitFor(() => result.current.isSuccess);
|
||||
await waitForNextUpdate();
|
||||
|
||||
expect(result.current.data).toStrictEqual([
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user