diff --git a/package-lock.json b/package-lock.json index 837fc8d32..fa744958e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "react-popper": "^2.3.0", "react-select": "^5.8.0", "react-slick": "^0.30.2", - "react-toastify": "^9.1.3", + "react-toastify": "^10.0.5", "ryze": "^0.1.2", "slick-carousel": "^1.8.1" }, @@ -4224,14 +4224,6 @@ "react-dom": "^16.8.0 || ^17.0.0 || >=18.0.0" } }, - "node_modules/@draft-js-plugins/mention/node_modules/clsx": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", - "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==", - "engines": { - "node": ">=6" - } - }, "node_modules/@dual-bundle/import-meta-resolve": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@dual-bundle/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", @@ -13963,9 +13955,9 @@ } }, "node_modules/clsx": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", - "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", + "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==", "engines": { "node": ">=6" } @@ -28056,15 +28048,15 @@ } }, "node_modules/react-toastify": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-9.1.3.tgz", - "integrity": "sha512-fPfb8ghtn/XMxw3LkxQBk3IyagNpF/LIKjOBflbexr2AWxAH1MJgvnESwEwBn9liLFXgTKWgBSdZpw9m4OTHTg==", + "version": "10.0.5", + "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-10.0.5.tgz", + "integrity": "sha512-mNKt2jBXJg4O7pSdbNUfDdTsK9FIdikfsIE/yUCxbAEXl4HMyJaivrVFcn3Elvt5xvCQYhUZm+hqTIu1UXM3Pw==", "dependencies": { - "clsx": "^1.1.1" + "clsx": "^2.1.0" }, "peerDependencies": { - "react": ">=16", - "react-dom": ">=16" + "react": ">=18", + "react-dom": ">=18" } }, "node_modules/react-transition-group": { diff --git a/package.json b/package.json index a9c2a579b..51e4aee78 100644 --- a/package.json +++ b/package.json @@ -176,7 +176,7 @@ "react-popper": "^2.3.0", "react-select": "^5.8.0", "react-slick": "^0.30.2", - "react-toastify": "^9.1.3", + "react-toastify": "^10.0.5", "ryze": "^0.1.2", "slick-carousel": "^1.8.1" }, diff --git a/src/components/Toast/index.spec.jsx b/src/components/Toast/index.spec.jsx index fcc233ac7..b325cb5b7 100644 --- a/src/components/Toast/index.spec.jsx +++ b/src/components/Toast/index.spec.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { toast } from 'react-toastify'; -import { render, screen, waitFor } from 'testing'; +import { render, screen, waitFor, act } from 'testing'; import Toast, { ToastMessage } from '.'; describe('Toast.notify', () => { @@ -8,8 +8,8 @@ describe('Toast.notify', () => { const toastSpy = jest.spyOn(toast, 'info'); render(); - Toast.notify({ - message: 'Testing Toast', + act(() => { + Toast.notify({ message: 'Testing Toast' }); }); expect(toastSpy).toHaveBeenCalledTimes(1); @@ -21,9 +21,8 @@ describe('Toast.notify', () => { it('should render default info type', async () => { render(); - Toast.notify({ - title: 'test', - message: 'Default toast', + act(() => { + Toast.notify({ title: 'test', message: 'Default toast' }); }); await waitFor(() => { expect(screen.getByClass('aui--toast-body-message')).toBeInTheDocument(); @@ -36,10 +35,12 @@ describe('Toast.notify', () => { it('should render success type', async () => { render(); - Toast.notify({ - title: 'SUCCESS', - theme: 'success', - message: 'Success toast', + act(() => { + Toast.notify({ + title: 'SUCCESS', + theme: 'success', + message: 'Success toast', + }); }); await waitFor(() => { expect(screen.getByClass('aui--toast-body-message')).toBeInTheDocument(); @@ -54,10 +55,12 @@ describe('Toast.notify', () => { it('should render alert type', async () => { render(); - Toast.notify({ - title: 'ALERT', - theme: 'alert', - message: 'Alert toast', + act(() => { + Toast.notify({ + title: 'ALERT', + theme: 'alert', + message: 'Alert toast', + }); }); await waitFor(() => { expect(screen.getByClass('aui--toast-body-message')).toBeInTheDocument(); @@ -72,10 +75,12 @@ describe('Toast.notify', () => { it('should render attention type', async () => { render(); - Toast.notify({ - title: 'ATTENTION', - theme: 'attention', - message: 'Attention toast', + act(() => { + Toast.notify({ + title: 'ATTENTION', + theme: 'attention', + message: 'Attention toast', + }); }); await waitFor(() => { expect(screen.getByClass('aui--toast-body-message')).toBeInTheDocument(); @@ -89,11 +94,12 @@ describe('Toast.notify', () => { it('should render info type', async () => { render(); - - Toast.notify({ - title: 'INFO', - theme: 'info', - message: 'Info toast', + act(() => { + Toast.notify({ + title: 'INFO', + theme: 'info', + message: 'Info toast', + }); }); await waitFor(() => { expect(screen.getByClass('aui--toast-body-message')).toBeInTheDocument(); @@ -120,10 +126,12 @@ describe('', () => { describe('', () => { it('should render Toast.Container without error', async () => { render(); - Toast.notify({ - title: 'test', - theme: 'attention', - message: 'Testing Toast', + act(() => { + Toast.notify({ + title: 'test', + theme: 'attention', + message: 'Testing Toast', + }); }); await waitFor(() => { expect(screen.getByClass('aui--toast-body-message')).toBeInTheDocument();