From 262c9472730a2c706e53cf2c29346eade4a161ce 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 2b064f6c10..5d58060155 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() =>