bito-code-review[bot] commented on code in PR #42737:
URL: https://github.com/apache/superset/pull/42737#discussion_r3708417289
##########
superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/useExploreAdditionalActionsMenu.test.tsx:
##########
@@ -112,6 +121,19 @@ beforeEach(() => {
mockExportChart.mockResolvedValue(undefined);
});
+test('hides Edit chart properties from a user who is not an owner/editor of
the chart (regression #38884)', async () => {
+ render(
+ <TestComponent
+ {...defaultProps}
+ slice={{ slice_id: 1, slice_name: 'Test Chart', editors: [2] }}
+ />,
+ { useRedux: true },
+ );
+
+ expect(await screen.findByText('Data Export Options')).toBeInTheDocument();
+ expect(screen.queryByText('Edit chart properties')).not.toBeInTheDocument();
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Test validates unimplemented gate</b></div>
<div id="fix">
This test correctly captures the regression (user without editor rights sees
the 'Edit chart properties' item), but the test will fail because the
production code at index.tsx line 584 only checks `if (slice)` — no
`userSubjects.has()` gate exists. Apply the same editors/user_subjects check
that ExploreChartHeader already uses (line 303) to the menu item at line 585.
</div>
</div>
<small><i>Code Review Run #dcbc6f</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]