bito-code-review[bot] commented on code in PR #42737:
URL: https://github.com/apache/superset/pull/42737#discussion_r3776890068
##########
superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx:
##########
@@ -626,6 +629,7 @@ describe('Additional actions tests', () => {
const props = createProps();
render(<ExploreHeader {...props} />, {
useRedux: true,
+ initialState: { explore: { can_overwrite: true, can_add: true } },
});
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Duplicated test initialState</b></div>
<div id="fix">
The `initialState: { explore: { can_overwrite: true, can_add: true } }`
object is duplicated across 3 render calls (lines 173, 632, 727). Consider
extracting to a shared constant like `const EDIT_PROPERTIES_INITIAL_STATE = {
explore: { can_overwrite: true, can_add: true } };` and reusing it. This
prevents divergence if the required state shape changes and aligns with the
test pattern used elsewhere in the file (e.g., line 800 uses `can_export_image`
from the same explore state).
</div>
</div>
<small><i>Code Review Run #f6676a</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]