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/01/08 14:13:19 UTC

[GitHub] [superset] villebro commented on a change in pull request #12352: Add ErrorBoudary for AdhocFilter components

villebro commented on a change in pull request #12352:
URL: https://github.com/apache/superset/pull/12352#discussion_r553965118



##########
File path: superset-frontend/spec/javascripts/explore/components/AdhocFilterEditPopover_spec.jsx
##########
@@ -47,6 +48,14 @@ const sqlAdhocFilter = new AdhocFilter({
   clause: CLAUSES.WHERE,
 });
 
+const faultiAdhocFilter = new AdhocFilter({
+  expressionType: null,
+  subject: null,
+  operator: '>',
+  comparator: '10',
+  clause: CLAUSES.WHERE,
+});

Review comment:
       ```suggestion
   const faultyAdhocFilter = new AdhocFilter({
     expressionType: null,
     subject: null,
     operator: '>',
     comparator: '10',
     clause: CLAUSES.WHERE,
   });
   ```

##########
File path: superset-frontend/spec/javascripts/explore/components/AdhocFilterEditPopover_spec.jsx
##########
@@ -97,6 +106,14 @@ describe('AdhocFilterEditPopover', () => {
     expect(wrapper.find(AdhocFilterEditPopoverSqlTabContent)).toExist();
   });
 
+  it('renders simple and sql tabs with ErrorBoundary instead of content', () => {
+    const { wrapper } = setup({ adhocFilter: faultiAdhocFilter });
+    expect(wrapper.find(Tabs)).toExist();
+    expect(wrapper.find(Tabs.TabPane)).toHaveLength(2);
+    expect(wrapper.find(Button)).toHaveLength(2);
+    expect(wrapper.find(ErrorBoundary)).toHaveLength(2);
+  });

Review comment:
       ```suggestion
     it('renders simple and sql tabs with ErrorBoundary instead of content', () => {
       const { wrapper } = setup({ adhocFilter: faultyAdhocFilter });
       expect(wrapper.find(Tabs)).toExist();
       expect(wrapper.find(Tabs.TabPane)).toHaveLength(2);
       expect(wrapper.find(Button)).toHaveLength(2);
       expect(wrapper.find(ErrorBoundary)).toHaveLength(2);
     });
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



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