mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
test: Fixes act errors in ErrorMessage tests (#21414)
This commit is contained in:
parent
8539d4cb67
commit
9c285dafb4
@ -23,6 +23,13 @@ import { supersetTheme } from '@superset-ui/core';
|
|||||||
import BasicErrorAlert from './BasicErrorAlert';
|
import BasicErrorAlert from './BasicErrorAlert';
|
||||||
import { ErrorLevel } from './types';
|
import { ErrorLevel } from './types';
|
||||||
|
|
||||||
|
jest.mock(
|
||||||
|
'src/components/Icons/Icon',
|
||||||
|
() =>
|
||||||
|
({ fileName }: { fileName: string }) =>
|
||||||
|
<span role="img" aria-label={fileName.replace('_', '-')} />,
|
||||||
|
);
|
||||||
|
|
||||||
const mockedProps = {
|
const mockedProps = {
|
||||||
body: 'Error body',
|
body: 'Error body',
|
||||||
level: 'warning' as ErrorLevel,
|
level: 'warning' as ErrorLevel,
|
||||||
|
@ -23,6 +23,13 @@ import userEvent from '@testing-library/user-event';
|
|||||||
import DatabaseErrorMessage from './DatabaseErrorMessage';
|
import DatabaseErrorMessage from './DatabaseErrorMessage';
|
||||||
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from './types';
|
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from './types';
|
||||||
|
|
||||||
|
jest.mock(
|
||||||
|
'src/components/Icons/Icon',
|
||||||
|
() =>
|
||||||
|
({ fileName }: { fileName: string }) =>
|
||||||
|
<span role="img" aria-label={fileName.replace('_', '-')} />,
|
||||||
|
);
|
||||||
|
|
||||||
const mockedProps = {
|
const mockedProps = {
|
||||||
error: {
|
error: {
|
||||||
error_type: ErrorTypeEnum.DATABASE_SECURITY_ACCESS_ERROR,
|
error_type: ErrorTypeEnum.DATABASE_SECURITY_ACCESS_ERROR,
|
||||||
|
@ -22,6 +22,13 @@ import { render, screen } from 'spec/helpers/testing-library';
|
|||||||
import DatasetNotFoundErrorMessage from './DatasetNotFoundErrorMessage';
|
import DatasetNotFoundErrorMessage from './DatasetNotFoundErrorMessage';
|
||||||
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from './types';
|
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from './types';
|
||||||
|
|
||||||
|
jest.mock(
|
||||||
|
'src/components/Icons/Icon',
|
||||||
|
() =>
|
||||||
|
({ fileName }: { fileName: string }) =>
|
||||||
|
<span role="img" aria-label={fileName.replace('_', '-')} />,
|
||||||
|
);
|
||||||
|
|
||||||
const mockedProps = {
|
const mockedProps = {
|
||||||
error: {
|
error: {
|
||||||
error_type: ErrorTypeEnum.FAILED_FETCHING_DATASOURCE_INFO_ERROR,
|
error_type: ErrorTypeEnum.FAILED_FETCHING_DATASOURCE_INFO_ERROR,
|
||||||
|
@ -23,6 +23,13 @@ import userEvent from '@testing-library/user-event';
|
|||||||
import ErrorMessageWithStackTrace from './ErrorMessageWithStackTrace';
|
import ErrorMessageWithStackTrace from './ErrorMessageWithStackTrace';
|
||||||
import { ErrorLevel, ErrorSource } from './types';
|
import { ErrorLevel, ErrorSource } from './types';
|
||||||
|
|
||||||
|
jest.mock(
|
||||||
|
'src/components/Icons/Icon',
|
||||||
|
() =>
|
||||||
|
({ fileName }: { fileName: string }) =>
|
||||||
|
<span role="img" aria-label={fileName.replace('_', '-')} />,
|
||||||
|
);
|
||||||
|
|
||||||
const mockedProps = {
|
const mockedProps = {
|
||||||
level: 'warning' as ErrorLevel,
|
level: 'warning' as ErrorLevel,
|
||||||
link: 'https://sample.com',
|
link: 'https://sample.com',
|
||||||
|
@ -23,6 +23,13 @@ import { render, screen } from 'spec/helpers/testing-library';
|
|||||||
import ParameterErrorMessage from './ParameterErrorMessage';
|
import ParameterErrorMessage from './ParameterErrorMessage';
|
||||||
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from './types';
|
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from './types';
|
||||||
|
|
||||||
|
jest.mock(
|
||||||
|
'src/components/Icons/Icon',
|
||||||
|
() =>
|
||||||
|
({ fileName }: { fileName: string }) =>
|
||||||
|
<span role="img" aria-label={fileName.replace('_', '-')} />,
|
||||||
|
);
|
||||||
|
|
||||||
const mockedProps = {
|
const mockedProps = {
|
||||||
error: {
|
error: {
|
||||||
error_type: ErrorTypeEnum.MISSING_TEMPLATE_PARAMS_ERROR,
|
error_type: ErrorTypeEnum.MISSING_TEMPLATE_PARAMS_ERROR,
|
||||||
|
@ -23,6 +23,13 @@ import { render, screen } from 'spec/helpers/testing-library';
|
|||||||
import TimeoutErrorMessage from './TimeoutErrorMessage';
|
import TimeoutErrorMessage from './TimeoutErrorMessage';
|
||||||
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from './types';
|
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from './types';
|
||||||
|
|
||||||
|
jest.mock(
|
||||||
|
'src/components/Icons/Icon',
|
||||||
|
() =>
|
||||||
|
({ fileName }: { fileName: string }) =>
|
||||||
|
<span role="img" aria-label={fileName.replace('_', '-')} />,
|
||||||
|
);
|
||||||
|
|
||||||
const mockedProps = {
|
const mockedProps = {
|
||||||
error: {
|
error: {
|
||||||
error_type: ErrorTypeEnum.FRONTEND_TIMEOUT_ERROR,
|
error_type: ErrorTypeEnum.FRONTEND_TIMEOUT_ERROR,
|
||||||
|
Loading…
Reference in New Issue
Block a user