This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 9c285dafb4 test: Fixes act errors in ErrorMessage tests (#21414)
9c285dafb4 is described below
commit 9c285dafb44a75cf0386fd4647a5b43a6fba1a48
Author: Michael S. Molina <[email protected]>
AuthorDate: Mon Sep 12 12:01:55 2022 -0300
test: Fixes act errors in ErrorMessage tests (#21414)
---
.../src/components/ErrorMessage/BasicErrorAlert.test.tsx | 7 +++++++
.../src/components/ErrorMessage/DatabaseErrorMessage.test.tsx | 7 +++++++
.../components/ErrorMessage/DatasetNotFoundErrorMessage.test.tsx | 7 +++++++
.../components/ErrorMessage/ErrorMessageWithStackTrace.test.tsx | 7 +++++++
.../src/components/ErrorMessage/ParameterErrorMessage.test.tsx | 7 +++++++
.../src/components/ErrorMessage/TimeoutErrorMessage.test.tsx | 7 +++++++
6 files changed, 42 insertions(+)
diff --git
a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx
b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx
index b6be9a1b9f..dd2187c931 100644
--- a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx
+++ b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx
@@ -23,6 +23,13 @@ import { supersetTheme } from '@superset-ui/core';
import BasicErrorAlert from './BasicErrorAlert';
import { ErrorLevel } from './types';
+jest.mock(
+ 'src/components/Icons/Icon',
+ () =>
+ ({ fileName }: { fileName: string }) =>
+ <span role="img" aria-label={fileName.replace('_', '-')} />,
+);
+
const mockedProps = {
body: 'Error body',
level: 'warning' as ErrorLevel,
diff --git
a/superset-frontend/src/components/ErrorMessage/DatabaseErrorMessage.test.tsx
b/superset-frontend/src/components/ErrorMessage/DatabaseErrorMessage.test.tsx
index 6959c5351a..c8dbe8ba34 100644
---
a/superset-frontend/src/components/ErrorMessage/DatabaseErrorMessage.test.tsx
+++
b/superset-frontend/src/components/ErrorMessage/DatabaseErrorMessage.test.tsx
@@ -23,6 +23,13 @@ import userEvent from '@testing-library/user-event';
import DatabaseErrorMessage from './DatabaseErrorMessage';
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from './types';
+jest.mock(
+ 'src/components/Icons/Icon',
+ () =>
+ ({ fileName }: { fileName: string }) =>
+ <span role="img" aria-label={fileName.replace('_', '-')} />,
+);
+
const mockedProps = {
error: {
error_type: ErrorTypeEnum.DATABASE_SECURITY_ACCESS_ERROR,
diff --git
a/superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.test.tsx
b/superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.test.tsx
index 087b08fa8f..e73d2eb93b 100644
---
a/superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.test.tsx
+++
b/superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.test.tsx
@@ -22,6 +22,13 @@ import { render, screen } from
'spec/helpers/testing-library';
import DatasetNotFoundErrorMessage from './DatasetNotFoundErrorMessage';
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from './types';
+jest.mock(
+ 'src/components/Icons/Icon',
+ () =>
+ ({ fileName }: { fileName: string }) =>
+ <span role="img" aria-label={fileName.replace('_', '-')} />,
+);
+
const mockedProps = {
error: {
error_type: ErrorTypeEnum.FAILED_FETCHING_DATASOURCE_INFO_ERROR,
diff --git
a/superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.test.tsx
b/superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.test.tsx
index 6e343eba7f..ae30e5cb99 100644
---
a/superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.test.tsx
+++
b/superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.test.tsx
@@ -23,6 +23,13 @@ import userEvent from '@testing-library/user-event';
import ErrorMessageWithStackTrace from './ErrorMessageWithStackTrace';
import { ErrorLevel, ErrorSource } from './types';
+jest.mock(
+ 'src/components/Icons/Icon',
+ () =>
+ ({ fileName }: { fileName: string }) =>
+ <span role="img" aria-label={fileName.replace('_', '-')} />,
+);
+
const mockedProps = {
level: 'warning' as ErrorLevel,
link: 'https://sample.com',
diff --git
a/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.test.tsx
b/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.test.tsx
index 17f38c4d23..e8be71b7e3 100644
---
a/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.test.tsx
+++
b/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.test.tsx
@@ -23,6 +23,13 @@ import { render, screen } from
'spec/helpers/testing-library';
import ParameterErrorMessage from './ParameterErrorMessage';
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from './types';
+jest.mock(
+ 'src/components/Icons/Icon',
+ () =>
+ ({ fileName }: { fileName: string }) =>
+ <span role="img" aria-label={fileName.replace('_', '-')} />,
+);
+
const mockedProps = {
error: {
error_type: ErrorTypeEnum.MISSING_TEMPLATE_PARAMS_ERROR,
diff --git
a/superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.test.tsx
b/superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.test.tsx
index e41308f538..cc3a8a9a59 100644
--- a/superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.test.tsx
+++ b/superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.test.tsx
@@ -23,6 +23,13 @@ import { render, screen } from
'spec/helpers/testing-library';
import TimeoutErrorMessage from './TimeoutErrorMessage';
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from './types';
+jest.mock(
+ 'src/components/Icons/Icon',
+ () =>
+ ({ fileName }: { fileName: string }) =>
+ <span role="img" aria-label={fileName.replace('_', '-')} />,
+);
+
const mockedProps = {
error: {
error_type: ErrorTypeEnum.FRONTEND_TIMEOUT_ERROR,