You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "msyavuz (via GitHub)" <gi...@apache.org> on 2025/11/04 11:41:01 UTC
Re: [PR] fix(DatabaseModal): prevent errors when pasting text into supported database select [superset]
msyavuz commented on code in PR #35916:
URL: https://github.com/apache/superset/pull/35916#discussion_r2490182046
##########
superset-frontend/src/features/databases/DatabaseModal/index.test.tsx:
##########
@@ -423,6 +424,45 @@ describe('DatabaseModal', () => {
expect(footer).toBeEmptyDOMElement();
});
+ test('shows filtered database options when pasting text in the select', async () => {
+ setup();
+
+ const modal = await screen.findByRole('dialog');
+ expect(modal).toBeInTheDocument();
+
+ // Find the select input (not opening the dropdown)
+ const selectInput = screen.getByRole('combobox');
+
+ // Simulate focusing the input
+ userEvent.click(selectInput);
+
+ // Simulate a paste event with clipboard data
+ fireEvent.paste(selectInput, {
+ clipboardData: {
+ getData: () => 'post',
+ },
+ });
+
+ fireEvent.change(selectInput, { target: { value: 'post' } });
Review Comment:
Is this correct? Do we not just trigger onChange with a setup like this?
```suggestion
fireEvent.paste(selectInput, {
clipboardData: {
getData: () => 'post',
},
});
```
--
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