mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
Setup timeout for logo update page due to slow image fetching
This commit is contained in:
parent
840391f541
commit
bd48a9fffd
@ -1,9 +1,11 @@
|
||||
import React from 'react';
|
||||
import { IntlProvider } from 'react-intl';
|
||||
import { render as renderTL, fireEvent, screen, waitFor } from '@testing-library/react';
|
||||
import { render as renderTL, fireEvent, screen, waitFor, configure } from '@testing-library/react';
|
||||
import { ThemeProvider, lightTheme } from '@strapi/design-system';
|
||||
import LogoInput from '../index';
|
||||
|
||||
configure({ asyncUtilTimeout: 8000 });
|
||||
|
||||
const getFakeSize = jest.fn(() => ({
|
||||
width: 500,
|
||||
height: 500,
|
||||
@ -28,7 +30,7 @@ const render = (props) =>
|
||||
<LogoInput
|
||||
{...props}
|
||||
defaultLogo="/admin/defaultLogo.png"
|
||||
onChangeLogo={() => jest.fn()}
|
||||
onChangeLogo={jest.fn()}
|
||||
onResetMenuLogo={jest.fn()}
|
||||
/>
|
||||
</IntlProvider>
|
||||
@ -172,7 +174,7 @@ describe('ApplicationsInfosPage || LogoInput', () => {
|
||||
|
||||
it('should show error message when uploading wrong file format', async () => {
|
||||
render();
|
||||
const changeLogoButton = document.querySelector('button');
|
||||
const changeLogoButton = screen.getByRole('button');
|
||||
fireEvent.click(changeLogoButton);
|
||||
fireEvent.click(screen.getByText('From url'));
|
||||
|
||||
@ -247,8 +249,11 @@ describe('ApplicationsInfosPage || LogoInput', () => {
|
||||
|
||||
it('should accept upload and lead user to next modal', async () => {
|
||||
render();
|
||||
|
||||
const changeLogoButton = document.querySelector('button');
|
||||
|
||||
fireEvent.click(changeLogoButton);
|
||||
|
||||
fireEvent.click(screen.getByText('From url'));
|
||||
|
||||
const textInput = document.querySelector('input[name="logo-url"]');
|
||||
|
Loading…
x
Reference in New Issue
Block a user