bito-code-review[bot] commented on code in PR #42529:
URL: https://github.com/apache/superset/pull/42529#discussion_r3663846490
##########
superset-frontend/src/features/home/Menu.test.tsx:
##########
@@ -1052,6 +1052,32 @@ describe('active tab highlighting (regression #36403)',
() => {
expect(getMenuItemByText('Дашборды')).toHaveClass('ant-menu-item-selected');
});
+ test.each([
+ ['/dataset/add/', 'the modern React dataset create route'],
+ ['/dataset/42', 'a dataset detail route'],
+ ])(
+ 'highlights the Datasets tab on %s (%s) — regression #42467',
+ async (route, _label) => {
+ // Legacy list URL (``/tablemodelview/list/``) already highlights the
+ // tab; these newer React-managed routes did not until #42467 added
+ // ``/dataset`` as a second prefix in the active-tab matcher.
+ useSelectorMock.mockReturnValue({ roles: user.roles });
+ window.history.pushState({}, '', route);
+
+ render(<Menu {...mockedProps} />, {
+ useRedux: true,
+ useQueryParams: true,
+ useRouter: true,
+ useTheme: true,
+ });
+
+ await screen.findByText('Datasets');
+ expect(getMenuItemByText('Datasets')).toHaveClass(
+ 'ant-menu-item-selected',
+ );
+ },
+ );
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing legacy route test case</b></div>
<div id="fix">
The `test.each` at line 1055 covers `/dataset/add/` and `/dataset/42` but
omits the legacy `/tablemodelview/list/` route. Line 1061's own comment says
this route 'already highlights the tab,' implying it works—but no test
exercises it. Adding the case ensures the comment's claim stays verified as the
path-matching logic evolves.
</div>
</div>
<small><i>Code Review Run #beceba</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]