Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSP-8586 : FT-REG: Subdivision/ Consolidation - Menu icon enlarges when user clicks on expand the left menu section #4077

Merged
merged 7 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions source/frontend/src/components/layout/SideNavBar/NavIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const NavIcon = ({ icon, text, showText, onClick, roles, claims }: INavIc
<TooltipWrapper tooltipId={`nav-tooltip-${text}`} tooltip={text}>
{icon}
</TooltipWrapper>
<StyledLabel className={clsx({ show: showText })}>{text}</StyledLabel>
{showText && <StyledLabel className={clsx({ show: showText })}>{text}</StyledLabel>}
</StyledLink>
</StyledNav>
) : null;
Expand All @@ -58,7 +58,8 @@ const StyledLabel = styled.label`
margin-bottom: 0;
font-size: 1.2rem;
color: white;
white-space: nowrap;
word-break: break-word;
white-space: break-spaces;
transition: width 0.25s;
width: 0;
overflow: hidden;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Claims, Roles } from '@/constants/index';

import { SideNavBar } from './SideNavbar';
import { render } from '@/utils/test-utils';
import { useKeycloak } from '@react-keycloak/web';
import { SidebarStateContextProvider } from './SideNavbarContext';

interface IRenderProps {
Expand Down Expand Up @@ -88,7 +87,7 @@ describe('SideNavbar display and logic', () => {
const { getByTitle, queryByText, getByTestId } = renderComponent();
await waitFor(async () => {
expect(getByTitle('expand')).toBeInTheDocument();
expect(queryByText('Leases & Licenses')?.clientWidth).toBe(0);
expect(queryByText('Leases & Licenses')).not.toBeInTheDocument();
expect(getByTestId('nav-tooltip-leases&licenses')).toContainHTML('svg');
});
});
Expand Down
Loading
Loading