sadpandajoe commented on code in PR #45604:
URL: https://github.com/apache/superset/pull/45604#discussion_r4365796449
##########
superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeControl.test.tsx:
##########
@@ -151,6 +151,33 @@ test('displays color scheme options', async () => {
});
});
+test('grouped-option styles reach the popup portaled to document.body', async
() => {
+ [...CategoricalD3, ...CategoricalModernSunset].forEach(scheme =>
+ getCategoricalSchemeRegistry().registerValue(scheme.id, scheme),
+ );
+ setup();
+ await userEvent.click(
+ screen.getByLabelText('Select color scheme', { selector: 'input' }),
+ );
+ await waitFor(() => {
+ expect(screen.getByText('Featured color palettes')).toBeInTheDocument();
+ });
+ const popup = document.querySelector('.ant-select-dropdown')!;
+ expect(popup.closest('body')).toBe(document.body);
Review Comment:
`popup.closest('body')` is `document.body` for any popup in the document,
including one rendered inline under the trigger's parent. If
`getPopupContainer` in `ColorSchemeControl` went back to
`triggerNode.parentNode`, this test would still pass while the double scrollbar
returned in a scrollable ancestor. The class assertion below only proves the
styles reach the popup root, not where it portals. Could this assert the popup
is not contained by the control's rendered container (as
`popupContainer.test.tsx` does for the Select default)?
--
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]