Skip to content

Commit a190c58

Browse files
test(UploadDataModal): fix async form validation with findByText
1 parent 4984cf1 commit a190c58

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* http://www.apache.org/licenses/LICENSE-2.0
1111
*
1212
* Unless required by applicable law or agreed to in writing,
13-
* software distributed under the License is distributed on an
13+
* software distributed under the License is distributed on
1414
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1515
* KIND, either express or implied. See the License for the
1616
* specific language governing permissions and limitations
@@ -427,15 +427,8 @@ describe('UploadDataModal - Form Validation', () => {
427427
const uploadButton = screen.getByRole('button', { name: 'Upload' });
428428
await userEvent.click(uploadButton);
429429

430-
await waitFor(() => {
431-
expect(
432-
screen.getByText('Uploading a file is required'),
433-
).toBeInTheDocument();
434-
expect(
435-
screen.getByText('Selecting a database is required'),
436-
).toBeInTheDocument();
437-
expect(screen.getByText('Table name is required')).toBeInTheDocument();
438-
});
430+
await screen.findByText('Uploading a file is required');
431+
await screen.findByText('Selecting a database is required');
439432
});
440433
});
441434

0 commit comments

Comments
 (0)