From f5ec8ce07ec8c40d4508fe9999476c4749133a52 Mon Sep 17 00:00:00 2001
From: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Date: Wed, 25 Jan 2023 07:36:19 -0600
Subject: [PATCH] test: Fix act errors in DatabaseModal test (#22846)
---
.../database/DatabaseModal/index.test.tsx | 31 ++++++++++++-------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.test.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.test.tsx
index 2b064f6c107d9..5d58060155f70 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.test.tsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.test.tsx
@@ -43,6 +43,25 @@ jest.mock('@superset-ui/core', () => ({
isFeatureEnabled: () => true,
}));
+jest.mock('src/components/Icons/Icon', () => ({
+ __esModule: true,
+ default: ({
+ fileName,
+ role,
+ ...rest
+ }: {
+ fileName: string;
+ role: string;
+ }) => (
+
+ ),
+ StyledIcon: () => ,
+}));
+
const dbProps = {
show: true,
database_name: 'my database',
@@ -354,11 +373,6 @@ describe('DatabaseModal', () => {
const preferredDbTextSQLite = within(preferredDbButtonSQLite).getByText(
/sqlite/i,
);
- // All dbs render with this icon in this testing environment,
- // The Icon count should equal the count of databases rendered
- const preferredDbIcon = screen.getAllByRole('img', {
- name: /default-icon/i,
- });
// renderAvailableSelector() =>