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


##########
superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx:
##########
@@ -2382,6 +2382,52 @@ describe('plugin-chart-table', () => {
       expect(filters[0].col).toBe('name');
       expect(filters[0].val).toEqual(['Michael']);
     });
+
+    test('excludes UUID columns from Search By dropdown', async () => {
+      const props = transformProps({
+        ...testData.basic,
+        formData: {
+          ...testData.basic.formData,
+          server_pagination: true,
+          include_search: true,
+        },
+        datasource: {
+          ...testData.basic.datasource,
+          columns: [
+            { column_name: 'name', type: 'VARCHAR' },
+            { column_name: 'uuid_col', type: 'UUID' },
+          ],
+        },
+        queriesData: [
+          {
+            ...testData.basic.queriesData[0],
+            colnames: ['name', 'uuid_col'],
+            coltypes: [GenericDataType.String, GenericDataType.String],
+            data: [
+              {
+                name: 'Michael',
+                uuid_col: '123e4567-e89b-12d3-a456-426614174000',
+              },
+            ],
+          },
+        ],
+      });
+
+      render(
+        <ProviderWrapper>
+          <TableChart {...props} sticky={false} />
+        </ProviderWrapper>,
+      );
+
+      // Open the dropdown
+      const searchBySelect = screen.getByRole('combobox');
+      fireEvent.mouseDown(searchBySelect);
+
+      // Normal string column is available
+      expect(await screen.findByTitle('name')).toBeInTheDocument();
+      // UUID column is explicitly excluded
+      expect(screen.queryByTitle('uuid_col')).not.toBeInTheDocument();

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Test relies on missing DOM title attribute</b></div>
   <div id="fix">
   
   Same as finding above — the test uses `screen.queryByTitle('uuid_col')` 
expecting to query by DOM title attribute, but Option elements lack the `title` 
prop. Add `title={label}` to the Option element so both assertions (lines 2427 
and 2429) work correctly.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #65201c</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx:
##########
@@ -2382,6 +2382,52 @@ describe('plugin-chart-table', () => {
       expect(filters[0].col).toBe('name');
       expect(filters[0].val).toEqual(['Michael']);
     });
+
+    test('excludes UUID columns from Search By dropdown', async () => {
+      const props = transformProps({
+        ...testData.basic,
+        formData: {
+          ...testData.basic.formData,
+          server_pagination: true,
+          include_search: true,
+        },
+        datasource: {
+          ...testData.basic.datasource,
+          columns: [
+            { column_name: 'name', type: 'VARCHAR' },
+            { column_name: 'uuid_col', type: 'UUID' },
+          ],
+        },
+        queriesData: [
+          {
+            ...testData.basic.queriesData[0],
+            colnames: ['name', 'uuid_col'],
+            coltypes: [GenericDataType.String, GenericDataType.String],
+            data: [
+              {
+                name: 'Michael',
+                uuid_col: '123e4567-e89b-12d3-a456-426614174000',
+              },
+            ],
+          },
+        ],
+      });
+
+      render(
+        <ProviderWrapper>
+          <TableChart {...props} sticky={false} />
+        </ProviderWrapper>,
+      );
+
+      // Open the dropdown
+      const searchBySelect = screen.getByRole('combobox');
+      fireEvent.mouseDown(searchBySelect);
+
+      // Normal string column is available
+      expect(await screen.findByTitle('name')).toBeInTheDocument();

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Test relies on missing DOM title attribute</b></div>
   <div id="fix">
   
   The test uses `screen.findByTitle('name')` (line 2427) expecting the Option 
to have a `title` attribute, but the `<Option value={val}>{label}</Option>` at 
line 89 in Select.tsx does not set `title={label}`. Without this attribute, 
`getByTitle`/`queryByTitle` queries will fail because they search the DOM's 
`title` attribute, not the displayed text. Add `title={label}` to the Option 
element to enable the test's accessibility-based queries.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #65201c</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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