geido commented on code in PR #33043:
URL: https://github.com/apache/superset/pull/33043#discussion_r2041758630


##########
superset-frontend/src/components/Select/Select.test.tsx:
##########
@@ -699,7 +662,7 @@ test('selects all values', async () => {
     />,
   );
   await open();
-  userEvent.click(await 
findSelectOption(selectAllOptionLabel(OPTIONS.length)));
+  userEvent.click(await 
screen.findByText(selectAllButtonText(OPTIONS.length)));

Review Comment:
   Can we use a role instead?



##########
superset-frontend/src/components/DatabaseSelector/DatabaseSelector.test.tsx:
##########
@@ -328,12 +328,18 @@ test('Should schema select display options', async () => {
   });
   expect(select).toBeInTheDocument();
   userEvent.click(select);
-  expect(
-    await screen.findByRole('option', { name: 'public' }),
-  ).toBeInTheDocument();
-  expect(
-    await screen.findByRole('option', { name: 'information_schema' }),
-  ).toBeInTheDocument();
+  await waitFor(() => {
+    expect(screen.queryByText('Loading...')).not.toBeInTheDocument();
+  });
+  const publicOption = await screen.findByText('public', {
+    selector: '.ant-select-item-option-content',

Review Comment:
   Let's look into this as I believe class names should be last resort



##########
superset-frontend/src/components/Select/Select.tsx:
##########
@@ -308,37 +310,32 @@ const Select = forwardRef(
 
     const handleOnDeselect: SelectProps['onDeselect'] = (value, option) => {
       if (Array.isArray(selectValue)) {
-        if (getValue(value) === getValue(SELECT_ALL_VALUE)) {
-          clear();
-        } else {
-          let array = selectValue as AntdLabeledValue[];
-          array = array.filter(
-            element => getValue(element) !== getValue(value),
+        let array = selectValue as AntdLabeledValue[];
+        array = array.filter(element => getValue(element) !== getValue(value));

Review Comment:
   I think we do not need this to be re-assignable after these changes



-- 
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