mirror of
https://github.com/strapi/strapi.git
synced 2025-12-25 14:14:10 +00:00
fix some review comments
This commit is contained in:
parent
417e130966
commit
f33fc37a86
@ -11,10 +11,9 @@ jest.mock('@strapi/helper-plugin', () => ({
|
||||
useOverlayBlocker: () => ({ lockApp: jest.fn(), unlockApp: jest.fn() }),
|
||||
}));
|
||||
|
||||
jest.mock('../../../utils', () => ({
|
||||
...jest.requireActual('../../../utils'),
|
||||
checkFormValidity: () => (null),
|
||||
}));
|
||||
const mockSchema = {
|
||||
validate: () => true
|
||||
}
|
||||
|
||||
const handlers = [
|
||||
rest.put('*/providers/options', (req, res, ctx) =>
|
||||
@ -57,9 +56,7 @@ describe('useSettingsForm', () => {
|
||||
server.close();
|
||||
});
|
||||
test('fetches all the providers options', async () => {
|
||||
const { result } = setup('/admin/providers/options', {
|
||||
validate: jest.fn()
|
||||
}, jest.fn(), ['autoRegister', 'defaultRole', 'ssoLockedRoles'] );
|
||||
const { result } = setup('/admin/providers/options', mockSchema, jest.fn(), ['autoRegister', 'defaultRole', 'ssoLockedRoles'] );
|
||||
|
||||
expect(result.current[0].isLoading).toBe(true);
|
||||
expect(result.current[0].formErrors).toStrictEqual({});
|
||||
@ -110,8 +107,9 @@ describe('useSettingsForm', () => {
|
||||
|
||||
const cbSucc = jest.fn();
|
||||
|
||||
const { result } = setup('/admin/providers/options', {}, cbSucc, ['autoRegister', 'defaultRole', 'ssoLockedRoles'] );
|
||||
const { result } = setup('/admin/providers/options', mockSchema, cbSucc, ['autoRegister', 'defaultRole', 'ssoLockedRoles'] );
|
||||
await waitFor(() => expect(result.current[0].isLoading).toBe(false));
|
||||
// call the handleSubmit handler to see if the data provided in modified data are cleaned without duplicates in the ssoLockedRoles list
|
||||
const e = { preventDefault: jest.fn() };
|
||||
await act(async () => {
|
||||
await result.current[2].handleSubmit(e);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -56,13 +56,11 @@ describe('ADMIN | Pages | Profile page | without SSO lock', () => {
|
||||
server.close();
|
||||
});
|
||||
|
||||
it('renders and matches the snapshot', async () => {
|
||||
const { container } = setup();
|
||||
it('renders and show the Interface Language section', async () => {
|
||||
setup();
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText('Interface language')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
expect(container.firstChild).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should display username if it exists', async () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user