Copilot commented on code in PR #43373:
URL: https://github.com/apache/superset/pull/43373#discussion_r3827176098


##########
superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx:
##########
@@ -278,6 +278,24 @@ describe('VizTypeControl', () => {
     ).not.toBeInTheDocument();
   });
 
+  test('Thumbnail labels expose the full chart name via a title tooltip', 
async () => {
+    // Labels are clamped to a fixed two-line block so every tile is the same
+    // height; the full (possibly truncated) name must stay discoverable 
through
+    // the title attribute.
+    await waitForRenderWrapper();
+    userEvent.click(screen.getByRole('tab', { name: 'All charts' }));
+
+    const visualizations = screen.getByTestId(getTestId('viz-row'));
+    const labels = await within(visualizations).findAllByTestId(
+      getTestId('viztype-label'),
+    );
+
+    expect(labels.length).toBeGreaterThan(0);
+    labels.forEach(label => {
+      expect(label).toHaveAttribute('title', label.textContent);
+    });

Review Comment:
   This assertion passes `label.textContent` (type `string | null`) into 
`toHaveAttribute`, which expects a `string | RegExp` and can fail TypeScript 
checks under `strictNullChecks`. Coerce to a string (or assert non-null) before 
passing it to the matcher.



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