rusackas commented on code in PR #41183:
URL: https://github.com/apache/superset/pull/41183#discussion_r3476797272
##########
superset-frontend/src/features/home/Menu.test.tsx:
##########
@@ -796,3 +796,105 @@ test('brand link falls back to brand.path when theme
brandLogoUrl is absent', as
// ensureAppRoot must have been applied: /welcome/ → /superset/welcome/
expect(brandLink).toHaveAttribute('href', '/superset/welcome/');
});
+
+// --- Active tab highlighting (regression tests for issue #36403) ---
+//
+// The active top-level tab is highlighted by matching the current route to a
+// menu item. The matching must rely on a stable identifier (the FAB `name`),
+// not the displayed label, otherwise highlighting breaks for any non-English
+// locale where the label is translated.
+
+// Returns the top-level <li> that contains the given visible text, so we can
+// assert whether antd marked it as the selected menu item.
+const getMenuItemByText = (text: string): HTMLElement | null =>
+ screen.getByText(text).closest('li');
+
+afterEach(() => {
Review Comment:
Good call — wrapped the three tests and their `afterEach` in a `describe` so
the route reset stays scoped to 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]