ramiroaquinoromero commented on code in PR #37479:
URL: https://github.com/apache/superset/pull/37479#discussion_r2741973176
##########
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:
Fixed! I've updated the tests to verify the actual "Select All" button
presence/absence in the DOM rather than just checking component rendering.
--
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]