sadpandajoe commented on code in PR #45605:
URL: https://github.com/apache/superset/pull/45605#discussion_r4354691083
##########
superset-frontend/src/preamble.test.ts:
##########
@@ -72,7 +72,9 @@ jest.mock('./utils/getBootstrapData', () => ({
jest.mock('./utils/pathUtils', () => ({
makeUrl: mockMakeUrl,
}));
-jest.mock('./hooks/useLocale', () => ({}));
+jest.mock('./hooks/useLocale', () => ({
Review Comment:
The `zh_TW` → `zh-tw` mapping is stubbed here but nothing in this suite
bootstraps `zh_TW`: the window-pack test only asserts `'fr'` and the
fetch-success test has no dayjs assertion. If either
`dayjs.locale(DAYJS_LOCALE_MAPPING[lang] ?? lang)` call in `preamble.ts` were
reverted to `dayjs.locale(lang)`, every test would still pass and `zh_TW` would
silently fall back to English again on the bootstrap path. Could you add a case
for each path (preloaded pack and successful fetch) with a `zh_TW` locale that
asserts `mockDayjsLocale` was called with `'zh-tw'`?
--
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]