Skip to content

Commit 5663da1

Browse files
authored
Merge pull request #78 from internxt/chore/bump-react-version
[_]: chore/update react version from peer dependencies
2 parents 808c5d0 + 30ce0be commit 5663da1

4 files changed

Lines changed: 297 additions & 157 deletions

File tree

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@internxt/ui",
3-
"version": "0.1.8",
3+
"version": "0.1.9",
44
"description": "Library of Internxt components",
55
"repository": {
66
"type": "git",
@@ -18,7 +18,8 @@
1818
],
1919
"peerDependencies": {
2020
"@phosphor-icons/react": "^2.1.10",
21-
"react": "^18.3.1",
21+
"react": ">=18.2.0",
22+
"react-dom": ">=18.2.0",
2223
"react-dnd": "16.0.1",
2324
"react-dnd-html5-backend": "^16.0.1"
2425
},

src/components/sidenav/__test__/Sidenav.test.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,18 +202,22 @@ describe('Sidenav Component', () => {
202202
});
203203

204204
it('hides option titles when collapsed', () => {
205-
const { queryByText } = renderSidenav({ isCollapsed: true });
206-
expect(queryByText('Inbox')).not.toBeInTheDocument();
207-
expect(queryByText('Sent')).not.toBeInTheDocument();
205+
const { getByText } = renderSidenav({ isCollapsed: true });
206+
const inboxText = getByText('Inbox');
207+
const sentText = getByText('Sent');
208+
expect(inboxText).toHaveClass('opacity-0');
209+
expect(sentText).toHaveClass('opacity-0');
208210
});
209211

210212
it('hides notifications when collapsed', () => {
211-
const { queryByText } = renderSidenav({ isCollapsed: true });
212-
expect(queryByText('5')).not.toBeInTheDocument();
213+
const { getByText } = renderSidenav({ isCollapsed: true });
214+
const notificationBadge = getByText('5').closest('div');
215+
expect(notificationBadge).toHaveClass('opacity-0');
216+
expect(notificationBadge).toHaveClass('invisible');
213217
});
214218

215219
it('hides storage when collapsed', () => {
216-
const { queryByText } = renderSidenav({
220+
const { getByText } = renderSidenav({
217221
isCollapsed: true,
218222
storage: {
219223
usage: '2.8 GB',
@@ -224,8 +228,10 @@ describe('Sidenav Component', () => {
224228
isLoading: false,
225229
},
226230
});
227-
expect(queryByText('2.8 GB')).not.toBeInTheDocument();
228-
expect(queryByText('Upgrade')).not.toBeInTheDocument();
231+
const usageText = getByText('2.8 GB');
232+
const storageContainer = usageText.closest('div')?.parentElement?.parentElement?.parentElement;
233+
expect(storageContainer).toHaveClass('opacity-0');
234+
expect(storageContainer).toHaveClass('invisible');
229235
});
230236

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

0 commit comments

Comments
 (0)