bito-code-review[bot] commented on code in PR #37479:
URL: https://github.com/apache/superset/pull/37479#discussion_r2741978593


##########
superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx:
##########
@@ -680,6 +683,90 @@ describe('SelectFilterPlugin', () => {
     expect(options[1]).toHaveTextContent('alpha');
     expect(options[2]).toHaveTextContent('beta');
   });
+
+  test('allowSelectAll is disabled when searchAllOptions is enabled and data 
is truncated at 1000 rows', () => {
+    // Create mock data with 1000 rows to simulate truncation
+    const largeData = Array.from({ length: 1000 }, (_, i) => ({
+      gender: `value_${i}`,
+    }));
+
+    const { container } = getWrapper({
+      searchAllOptions: true,
+      multiSelect: true,
+      queriesData: [
+        {
+          rowcount: 1000,
+          colnames: ['gender'],
+          coltypes: [1],
+          data: largeData,
+          applied_filters: [{ column: 'gender' }],
+          rejected_filters: [],
+        },
+      ],
+    });
+    // Verify the Select component is rendered with multiSelect mode
+    const selectElement = container.querySelector('.ant-select-multiple');
+    expect(selectElement).toBeInTheDocument();
+    // Note: allowSelectAll is disabled because with searchAllOptions + 1000 
rows,
+    // data is likely truncated, so "Select All" would be misleading
+  });

Review Comment:
   <!-- Bito Reply -->
   The test updates now check for the 'Select All' button's presence/absence in 
the DOM using screen.queryByText and screen.findByText, directly validating the 
allowSelectAll behavior instead of just component rendering. This addresses the 
review comment on insufficient assertions.
   
   
**superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx**
   ```
   // Verify "Select All" button is NOT present (disabled due to truncation)
       expect(screen.queryByText(/Select all/i)).not.toBeInTheDocument();
   ```



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