You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ly...@apache.org on 2023/01/25 02:51:19 UTC

[superset] branch lyndsi/fix-act-errors-DatabaseModal created (now 8bf48d7541)

This is an automated email from the ASF dual-hosted git repository.

lyndsi pushed a change to branch lyndsi/fix-act-errors-DatabaseModal
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 8bf48d7541 Removed 9 act errors

This branch includes the following new commits:

     new 8bf48d7541 Removed 9 act errors

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[superset] 01/01: Removed 9 act errors

Posted by ly...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lyndsi pushed a commit to branch lyndsi/fix-act-errors-DatabaseModal
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 8bf48d754111ec38fbd74598f880437997267d1d
Author: lyndsiWilliams <kc...@gmail.com>
AuthorDate: Tue Jan 24 20:48:13 2023 -0600

    Removed 9 act errors
---
 .../data/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;
+  }) => (
+    <span
+      role={role ?? 'img'}
+      aria-label={fileName.replace('_', '-')}
+      {...rest}
+    />
+  ),
+  StyledIcon: () => <span />,
+}));
+
 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() => <Select> - Supported databases selector
       const supportedDbsHeader = screen.getByRole('heading', {
         name: /or choose from a list of other databases we support:/i,
@@ -399,10 +413,6 @@ describe('DatabaseModal', () => {
         preferredDbButtonPresto,
         preferredDbButtonMySQL,
         preferredDbButtonSQLite,
-        preferredDbIcon[0],
-        preferredDbIcon[1],
-        preferredDbIcon[2],
-        preferredDbIcon[3],
         preferredDbTextPostgreSQL,
         preferredDbTextPresto,
         preferredDbTextMySQL,
@@ -414,9 +424,6 @@ describe('DatabaseModal', () => {
       });
       // there should be a footer but it should not have any buttons in it
       expect(footer[0]).toBeEmptyDOMElement();
-
-      // This is how many preferred databases are rendered
-      expect(preferredDbIcon).toHaveLength(5);
     });
 
     test('renders the "Basic" tab of SQL Alchemy form (step 2 of 2) correctly', async () => {