From 31cd8f42543694bc5891ded3e8d0ac0ea8c77d94 Mon Sep 17 00:00:00 2001 From: lyndsiWilliams Date: Mon, 20 Dec 2021 02:01:55 -0600 Subject: [PATCH] Fix tests --- .../src/components/Datasource/DatasourceEditor.test.jsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx b/superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx index a0d46a6f1ac0b..dc85ad88a0bed 100644 --- a/superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx +++ b/superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx @@ -78,7 +78,7 @@ describe('DatasourceEditor', () => { }); userEvent.click(getToggles[0]); const getTextboxes = screen.getAllByRole('textbox'); - expect(getTextboxes.length).toEqual(5); + expect(getTextboxes.length).toEqual(12); const inputLabel = screen.getByPlaceholderText('Label'); const inputDescription = screen.getByPlaceholderText('Description'); @@ -122,10 +122,9 @@ describe('DatasourceEditor', () => { }); expect(addBtn).toBeInTheDocument(); userEvent.click(addBtn); - const newColumn = screen.getByRole('button', { - name: //i, - }); - expect(newColumn).toBeInTheDocument(); + // newColumn (Column name) is the first textbox in the tab + const newColumn = screen.getAllByRole('textbox', { name: '' })[0]; + expect(newColumn).toHaveValue(''); }); it('renders isSqla fields', () => {