eschutho commented on a change in pull request #14845:
URL: https://github.com/apache/superset/pull/14845#discussion_r644308558



##########
File path: 
superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.test.jsx
##########
@@ -203,68 +203,68 @@ describe('DatabaseModal', () => {
     // Both checkboxes go unchecked, so the field should no longer render
     expect(schemaField).not.toHaveClass('open');
   });
-
-  describe('create database', () => {
-    beforeEach(() => {
-      fetchMock.post(DATABASE_POST_ENDPOINT, {
-        id: 10,
-      });
-      fetchMock.mock(AVAILABLE_DB_ENDPOINT, {
-        databases: [
-          {
-            engine: 'mysql',
-            name: 'MySQL',
-            preferred: false,
-          },
-        ],
-      });
-    });
-    const props = {
-      ...dbProps,
-      databaseId: null,
-      database_name: null,
-      sqlalchemy_uri: null,
-    };
-    it('should show a form when dynamic_form is selected', async () => {
-      render(<DatabaseModal {...props} />, { useRedux: true });
-      // it should have the correct header text
-      const headerText = screen.getByText(/connect a database/i);
-      expect(headerText).toBeVisible();
-
-      await screen.findByText(/display name/i);
-
-      // it does not fetch any databases if no id is passed in
-      expect(fetchMock.calls(DATABASE_FETCH_ENDPOINT).length).toEqual(0);
-
-      // todo we haven't hooked this up to load dynamically yet so
-      // we can't currently test it
-    });
-    it('should close the modal on save if using the sqlalchemy form', async () 
=> {
-      const onHideMock = jest.fn();
-      render(<DatabaseModal {...props} onHide={onHideMock} />, {
-        useRedux: true,
-      });
-      // button should be disabled by default
-      const submitButton = screen.getByTestId('modal-confirm-button');
-      expect(submitButton).toBeDisabled();
-
-      const displayName = screen.getByTestId('database-name-input');
-      userEvent.type(displayName, 'MyTestDB');
-      expect(displayName.value).toBe('MyTestDB');
-      const sqlalchemyInput = screen.getByTestId('sqlalchemy-uri-input');
-      userEvent.type(sqlalchemyInput, 'some_url');
-      expect(sqlalchemyInput.value).toBe('some_url');
-
-      // button should not be disabled now
-      expect(submitButton).toBeEnabled();
-
-      await waitFor(() => {
-        userEvent.click(submitButton);
-      });
-      expect(fetchMock.calls(DATABASE_POST_ENDPOINT)).toHaveLength(1);
-      expect(onHideMock).toHaveBeenCalled();
-    });
-  });
+  // TODO: rewrite when Modal is complete

Review comment:
       curious what broke the database creation test?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to