mirror of
https://github.com/strapi/strapi.git
synced 2025-07-13 12:02:10 +00:00

* fix(admin): reset all redux toolkit cache on logout * chore: refactor API to use one createApi call from redux/toolkit * chore: fix e2e suite * chore: spelling error Co-authored-by: Bassel Kanso <basselkanso82@gmail.com> * chore: remove rogue import --------- Co-authored-by: Bassel Kanso <basselkanso82@gmail.com>
33 lines
808 B
TypeScript
33 lines
808 B
TypeScript
/* eslint-disable check-file/filename-naming-convention */
|
|
import * as React from 'react';
|
|
|
|
import {
|
|
renderHook as renderHookAdmin,
|
|
render as renderAdmin,
|
|
waitFor,
|
|
act,
|
|
screen,
|
|
type RenderOptions,
|
|
} from '@strapi/admin/strapi-admin/test';
|
|
|
|
import { PERMISSIONS } from '../src/constants';
|
|
|
|
import { server } from './server';
|
|
|
|
const render = (
|
|
ui: React.ReactElement,
|
|
options: RenderOptions = {}
|
|
): ReturnType<typeof renderAdmin> =>
|
|
renderAdmin(ui, {
|
|
...options,
|
|
providerOptions: { permissions: Object.values(PERMISSIONS).flat() },
|
|
});
|
|
|
|
const renderHook: typeof renderHookAdmin = (hook, options) =>
|
|
renderHookAdmin(hook, {
|
|
...options,
|
|
providerOptions: { permissions: Object.values(PERMISSIONS).flat() },
|
|
});
|
|
|
|
export { render, renderHook, waitFor, server, act, screen };
|