You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/09/20 19:27:53 UTC

[GitHub] [superset] michael-s-molina commented on a change in pull request #16510: chore: Select component refactoring - SelectControl - Iteration 5

michael-s-molina commented on a change in pull request #16510:
URL: https://github.com/apache/superset/pull/16510#discussion_r712447310



##########
File path: superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx
##########
@@ -82,10 +82,22 @@ test('renders extra checkboxes when type is time series', () => {
 });
 
 test('enables apply and ok buttons', async () => {
-  render(<AnnotationLayer {...defaultProps} />);
-  userEvent.type(screen.getByLabelText('Name'), 'Test');
-  userEvent.type(screen.getByLabelText('Formula'), '2x');
-  await waitFor(() => {
+  const { container } = render(<AnnotationLayer {...defaultProps} />);
+
+  waitFor(() => {

Review comment:
       ```suggestion
     await waitFor(() => {
   ```

##########
File path: superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx
##########
@@ -82,10 +82,22 @@ test('renders extra checkboxes when type is time series', () => {
 });
 
 test('enables apply and ok buttons', async () => {
-  render(<AnnotationLayer {...defaultProps} />);
-  userEvent.type(screen.getByLabelText('Name'), 'Test');
-  userEvent.type(screen.getByLabelText('Formula'), '2x');
-  await waitFor(() => {
+  const { container } = render(<AnnotationLayer {...defaultProps} />);
+
+  waitFor(() => {
+    expect(container).toBeInTheDocument();
+  });
+
+  const nameInput = screen.getByRole('textbox', { name: 'Name' });
+  const formulaInput = screen.getByRole('textbox', { name: 'Formula' });
+
+  expect(nameInput).toBeInTheDocument();
+  expect(formulaInput).toBeInTheDocument();
+
+  userEvent.type(nameInput, 'Name');
+  userEvent.type(formulaInput, '2x');
+
+  waitFor(() => {

Review comment:
       ```suggestion
     await waitFor(() => {
   ```




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org