alex-poor commented on code in PR #40679:
URL: https://github.com/apache/superset/pull/40679#discussion_r3877191925
##########
superset-frontend/src/pages/ChartList/ChartList.test.tsx:
##########
@@ -273,6 +273,34 @@ describe('ChartList', () => {
expect(screen.queryByTestId('delete-modal-input')).not.toBeInTheDocument();
});
+
+ test('renders the localized chart name, falling back to slice_name', async
() => {
+ // Served from a response of its own rather than the shared mock, which
+ // other suites assert against by canonical name.
+ const [translated, untranslated] = mockCharts;
+ fetchMock.removeRoutes();
Review Comment:
Tried this and it does not work here, so I have kept `removeRoutes()` and
documented why in 5d2015956.
The helper registers an unnamed catch-all (`CATCH_ALL: 'glob:*'`) after the
chart route. Removing and re-adding just the chart route puts it behind that
glob, which then answers the request, and the test fails to find the translated
name. Re-adding the catch-all afterwards fails differently: the info endpoint
starts returning `{result: [], count: 0}` and the list renders no rows.
Worth noting the sibling at line 220 that you cite appears to pass for that
reason rather than in spite of it -- it asserts only that the component
renders, and the empty payload it expects is exactly what the catch-all
returns. The loading-state test just above, which does assert on chart data,
uses the same full reset this test does.
--
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]