Skip to content

Commit

Permalink
Merge pull request #149 from Orfium/hotfix/add_test_ids
Browse files Browse the repository at this point in the history
fix: add test ids to global nav
  • Loading branch information
mkarajohn authored May 8, 2024
2 parents b45b5b9 + 87b2952 commit 93f98e8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ui/Navigation/components/GlobalNav/GlobalNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function GlobalNavLink(props: GlobalNavLinkProps) {

return (
<AppIconRRLink
data-testid={'toolbox-admin-button'}
theme={theme}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Expand Down Expand Up @@ -119,12 +120,20 @@ function GlobalNav(props: GlobalNavProps) {
const isCurrentApp = p.client_metadata.product_code === config.productCode;
const Icon = productIconsDict[p.client_metadata.product_code];

// TODO: We could be using the provided `p.icon_url` and not have to keep our own
// dictionary of product codes and icons, but that would need changes on the CSP side
// of things, cause otherwise the resources get blocked

return (
<Tooltip key={p.client_id} content={p.name} placement={'right'}>
{/* App icon wrapper is needed to add extra distance between the icon and the tooltip */}
{/* since the tooltip cannot adjust its distance from the trigger element */}
<AppIconWrapper>
<AppIconNativeLink href={p.login_url} className={isCurrentApp ? 'active' : ''}>
<AppIconNativeLink
data-testid={p.client_metadata.product_code}
href={p.login_url}
className={isCurrentApp ? 'active' : ''}
>
{/* @ts-ignore*/}
<Icon alt={p.name} />
</AppIconNativeLink>
Expand Down

0 comments on commit 93f98e8

Please sign in to comment.