Copilot commented on code in PR #42652:
URL: https://github.com/apache/superset/pull/42652#discussion_r3714802738
##########
superset-frontend/src/components/ErrorMessage/OAuth2RedirectMessage.test.tsx:
##########
@@ -146,6 +146,17 @@ describe('OAuth2RedirectMessage Component', () => {
expect(getByText(/provide authorization/i)).toBeInTheDocument();
});
+ test('renders the prose body without preformatted/monospace styling so it
wraps within the popover', () => {
+ const { container } = render(setup());
+
+ // The OAuth2 body is prose, not a stack trace, so it must not be styled as
+ // preformatted (monospace + pre-wrap). Otherwise it renders as a single
+ // unwrapped line that balloons the SQL Lab popover width.
+ const description = container.querySelector('[data-testid="description"]');
+ expect(description).not.toBeNull();
+ expect(description).not.toHaveStyle({ whiteSpace: 'pre-wrap' });
Review Comment:
`querySelector` returns `Element | null`, and the
`expect(...).not.toBeNull()` assertion does not narrow the TypeScript type.
This can cause a TS compile error (and would also make the next assertion throw
if the selector ever fails). Prefer using RTL’s `getByTestId('description')`
(which throws with a clearer error) or strongly type/narrow the element before
calling `toHaveStyle` (e.g., `querySelector<HTMLElement>(...)` and an explicit
null guard/cast).
##########
superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx:
##########
@@ -135,6 +135,7 @@ const SqlEditorLeftBar = ({
data-test="DatabaseSelector"
css={css`
min-width: 500px;
+ max-width: 500px;
Review Comment:
Setting `min-width` and `max-width` to the same value effectively creates a
fixed width; using `width: 500px` would communicate intent more clearly and
reduce redundancy. If a fixed width is intended, consider replacing these two
declarations with a single `width` rule.
--
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]