sadpandajoe commented on code in PR #40297:
URL: https://github.com/apache/superset/pull/40297#discussion_r3877738438


##########
superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx:
##########
@@ -203,6 +205,30 @@ describe('SelectFilterPlugin', () => {
     });
   });
 
+  test('uses document.body as popup container in dashboard filter bar', () => {
+    const container = getSelectPopupContainer(AppSection.Dashboard, false);
+    expect(container(document.createElement('div'))).toBe(document.body);
+  });
+
+  test('uses parent ref as popup container for overflowed filters', () => {
+    const parentNode = document.createElement('div');
+    const container = getSelectPopupContainer(AppSection.Dashboard, true, {
+      current: parentNode,
+    });
+    expect(container()).toBe(parentNode);

Review Comment:
   This makes the test fail type checking: the helper's inferred return type is 
a union of callbacks, one requiring `trigger`, so `container()` is rejected at 
this call site. Could the helper expose one callback signature with an optional 
trigger?



-- 
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: [email protected]

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