Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@internxt/ui",
"version": "0.1.8",
"version": "0.1.9",
"description": "Library of Internxt components",
"repository": {
"type": "git",
Expand All @@ -18,7 +18,8 @@
],
"peerDependencies": {
"@phosphor-icons/react": "^2.1.10",
"react": "^18.3.1",
"react": ">=18.2.0",
"react-dom": ">=18.2.0",
"react-dnd": "16.0.1",
"react-dnd-html5-backend": "^16.0.1"
},
Expand Down
22 changes: 14 additions & 8 deletions src/components/sidenav/__test__/Sidenav.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,22 @@ describe('Sidenav Component', () => {
});

it('hides option titles when collapsed', () => {
const { queryByText } = renderSidenav({ isCollapsed: true });
expect(queryByText('Inbox')).not.toBeInTheDocument();
expect(queryByText('Sent')).not.toBeInTheDocument();
const { getByText } = renderSidenav({ isCollapsed: true });
const inboxText = getByText('Inbox');
const sentText = getByText('Sent');
expect(inboxText).toHaveClass('opacity-0');
expect(sentText).toHaveClass('opacity-0');
});

it('hides notifications when collapsed', () => {
const { queryByText } = renderSidenav({ isCollapsed: true });
expect(queryByText('5')).not.toBeInTheDocument();
const { getByText } = renderSidenav({ isCollapsed: true });
const notificationBadge = getByText('5').closest('div');
expect(notificationBadge).toHaveClass('opacity-0');
expect(notificationBadge).toHaveClass('invisible');
});

it('hides storage when collapsed', () => {
const { queryByText } = renderSidenav({
const { getByText } = renderSidenav({
isCollapsed: true,
storage: {
usage: '2.8 GB',
Expand All @@ -224,8 +228,10 @@ describe('Sidenav Component', () => {
isLoading: false,
},
});
expect(queryByText('2.8 GB')).not.toBeInTheDocument();
expect(queryByText('Upgrade')).not.toBeInTheDocument();
const usageText = getByText('2.8 GB');
const storageContainer = usageText.closest('div')?.parentElement?.parentElement?.parentElement;
expect(storageContainer).toHaveClass('opacity-0');
expect(storageContainer).toHaveClass('invisible');
});

it('hides subsections when collapsed even if showSubsections is true', () => {
Expand Down
Loading