This is an automated email from the ASF dual-hosted git repository.

jli pushed a commit to branch feat-chart-list-rtl-tests
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 4f0ef8771917944d5c75a3c0a1412c3ca2352942
Author: Joe Li <[email protected]>
AuthorDate: Fri Feb 6 09:45:29 2026 -0800

    test(chart-list): add RTL test for dashboard crosslinks rendering
    
    Verifies that dashboard crosslinks render as navigable links with correct
    hrefs in the chart list view, replacing Cypress coverage.
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
 .../src/pages/ChartList/ChartList.listview.test.tsx  | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/superset-frontend/src/pages/ChartList/ChartList.listview.test.tsx 
b/superset-frontend/src/pages/ChartList/ChartList.listview.test.tsx
index 094e5530bcd..43827328b6b 100644
--- a/superset-frontend/src/pages/ChartList/ChartList.listview.test.tsx
+++ b/superset-frontend/src/pages/ChartList/ChartList.listview.test.tsx
@@ -585,6 +585,26 @@ test('ChartList list view displays chart with empty on 
dashboards column', async
   expect(within(dashboardCell).queryByRole('link')).not.toBeInTheDocument();
 });
 
+test('renders dashboard crosslinks as navigable links', async () => {
+  renderChartList(mockUser);
+  await waitFor(() => {
+    expect(screen.getByTestId('listview-table')).toBeInTheDocument();
+  });
+
+  const table = screen.getByTestId('listview-table');
+
+  // mockCharts[1] has 3 dashboards - verify all render with correct hrefs
+  const chartRow = within(table)
+    .getByText(mockCharts[1].slice_name)
+    .closest('[data-test="table-row"]') as HTMLElement;
+  const crosslinks = within(chartRow).getByTestId('crosslinks');
+  const links = within(crosslinks).getAllByRole('link');
+  expect(links).toHaveLength(3);
+  expect(links[0]).toHaveAttribute('href', '/superset/dashboard/2');
+  expect(links[1]).toHaveAttribute('href', '/superset/dashboard/3');
+  expect(links[2]).toHaveAttribute('href', '/superset/dashboard/4');
+});
+
 test('ChartList list view shows tag info when TAGGING_SYSTEM is enabled', 
async () => {
   // Enable tagging system feature flag
   mockIsFeatureEnabled.mockImplementation(

Reply via email to