bito-code-review[bot] commented on code in PR #41636: URL: https://github.com/apache/superset/pull/41636#discussion_r3558810332
########## superset-frontend/playwright/tests/home/welcome.spec.ts: ########## @@ -0,0 +1,36 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { test, expect } from '@playwright/test'; +import { URL } from '../../utils/urls'; +import { TIMEOUT } from '../../utils/constants'; + +// Smoke test guarding against a blank Home/welcome landing page (e.g. a shell +// or route-layout regression that renders only the top navigation). The auth +// suite only waits for the welcome URL + session cookie, so it would not catch +// a welcome page that redirects correctly but renders no content. +test('welcome page renders its content, not just the nav', async ({ page }) => { + await page.goto(`/${URL.WELCOME}`); + + // "Recents" is a Home content section header (a Collapse panel) that does not + // exist in the top navigation, so its presence proves the route content + // rendered — not just the app shell. + await expect(page.getByText('Recents', { exact: true })).toBeVisible({ Review Comment: <div> <div id="suggestion"> <div id="issue"><b>Hardcoded string bypasses i18n</b></div> <div id="fix"> The test hardcodes the English string 'Recents' while the actual Home page uses `t('Recents')` for i18n. This will cause the test to fail when the application runs in a non-English locale. Import and use the same translation mechanism the Home component uses. </div> </div> <small><i>Code Review Run #a3849d</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/jest.config.js: ########## @@ -75,7 +75,7 @@ module.exports = { // @ant-design/colors and @ant-design/fast-color are allowed through because // @ant-design/icons >= 6.3 deep-imports the ESM build of @ant-design/colors // from its CJS output, so babel-jest must transform those files. - 'node_modules/(?!@ant-design/(colors|fast-color)|@formatjs/.*|d3-(array|interpolate|color|time|scale|time-format|format)|internmap|@mapbox/tiny-sdf|remark-gfm|(?!@ngrx|(?!deck.gl)|d3-scale)|markdown-table|micromark-*.|decode-named-character-reference|character-entities|mdast-util-*.|unist-util-*.|ccount|escape-string-regexp|nanoid|uuid|@rjsf/*.|echarts|zrender|fetch-mock|pretty-ms|parse-ms|ol|@babel/runtime|@emotion|cheerio|cheerio/lib|parse5|dom-serializer|entities|htmlparser2|rehype-sanitize|hast-util-sanitize|unified|unist-.*|hast-.*|rehype-.*|remark-.*|mdast-.*|micromark-.*|parse-entities|property-information|space-separated-tokens|comma-separated-tokens|bail|devlop|zwitch|longest-streak|geostyler|geostyler-.*|(?!geostyler)lodash|react-error-boundary|react-json-tree|react-base16-styling|lodash-es|rbush|quickselect|react-diff-viewer-continued|storybook/*.|json-stringify-pretty-compact)', + 'node_modules/(?!@ant-design/(colors|fast-color)|@formatjs/.*|d3-(array|interpolate|color|time|scale|time-format|format)|internmap|@mapbox/tiny-sdf|remark-gfm|(?!@ngrx|(?!deck.gl)|d3-scale)|markdown-table|micromark-*.|decode-named-character-reference|character-entities|mdast-util-*.|unist-util-*.|ccount|escape-string-regexp|nanoid|uuid|@rjsf/*.|@x0k/.*|echarts|zrender|fetch-mock|pretty-ms|parse-ms|ol|@babel/runtime|@emotion|cheerio|cheerio/lib|parse5|dom-serializer|entities|htmlparser2|rehype-sanitize|hast-util-sanitize|unified|unist-.*|hast-.*|rehype-.*|remark-.*|mdast-.*|micromark-.*|parse-entities|property-information|space-separated-tokens|comma-separated-tokens|bail|devlop|zwitch|longest-streak|geostyler|geostyler-.*|(?!geostyler)lodash|react-error-boundary|react-json-tree|react-base16-styling|lodash-es|rbush|quickselect|react-diff-viewer-continued|storybook/*.|json-stringify-pretty-compact)', Review Comment: <div> <div id="suggestion"> <div id="issue"><b>Dead code in Jest config</b></div> <div id="fix"> The `@x0k/.*` entry in `transformIgnorePatterns` is unused dead code. No packages from the `@x0k` namespace are imported anywhere in the source tree (verified via grep across all TS/JS files). The entry exists in the lockfile as a transitive dependency but is never imported. While this causes no functional harm, it clutters the Jest configuration and may confuse future maintainers about what packages require transformation. </div> </div> <small><i>Code Review Run #a3849d</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]
