diff --git a/package-lock.json b/package-lock.json index c6f3bf40f46901891a205f85ed4f4913ea39197d..32205168fb58eae02fa3d4a9f2c7aa851396f44f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,6 @@ "@commitlint/config-conventional": "^17.7.0", "@testing-library/jest-dom": "^6.1.3", "@testing-library/react": "^14.0.0", - "@testing-library/user-event": "^14.5.1", "@typescript-eslint/eslint-plugin": "^6.7.0", "@typescript-eslint/parser": "^6.7.0", "cypress": "^13.2.0", @@ -2267,19 +2266,6 @@ "react-dom": "^18.0.0" } }, - "node_modules/@testing-library/user-event": { - "version": "14.5.1", - "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.5.1.tgz", - "integrity": "sha512-UCcUKrUYGj7ClomOo2SpNVvx4/fkd/2BbIHDCle8A0ax+P3bU7yJwDBDrS6ZwdTMARWTGODX1hEsCcO+7beJjg==", - "dev": true, - "engines": { - "node": ">=12", - "npm": ">=6" - }, - "peerDependencies": { - "@testing-library/dom": ">=7.21.4" - } - }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", diff --git a/package.json b/package.json index 1ac2ca8c964e2cdc0836037d48d018692ba33987..a840cf2fad07c115fec8d24c65a9e063e32b8bdd 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "@commitlint/config-conventional": "^17.7.0", "@testing-library/jest-dom": "^6.1.3", "@testing-library/react": "^14.0.0", - "@testing-library/user-event": "^14.5.1", "@typescript-eslint/eslint-plugin": "^6.7.0", "@typescript-eslint/parser": "^6.7.0", "cypress": "^13.2.0", diff --git a/src/components/Map/Drawer/Drawer.component.test.tsx b/src/components/Map/Drawer/Drawer.component.test.tsx index cfa8ef66b493b98a49aa6f343c6e1bd234f56ac7..af462cab5db5d8323374e6309a741e8d28f80aae 100644 --- a/src/components/Map/Drawer/Drawer.component.test.tsx +++ b/src/components/Map/Drawer/Drawer.component.test.tsx @@ -1,5 +1,4 @@ import { screen, render, RenderResult } from '@testing-library/react'; -import { userEvent } from '@testing-library/user-event'; import { Drawer } from './Drawer.component'; const renderComponent = (): RenderResult => render(<Drawer />); @@ -10,34 +9,4 @@ describe('Drawer - component', () => { expect(screen.getByRole('drawer')).toBeInTheDocument(); }); - - it('should be closes', () => { - renderComponent(); - - expect(screen.getByRole('drawer')).toHaveClass('hidden'); - expect(screen.getByRole('drawer')).not.toHaveClass('block'); - }); - - it('should be open', async () => { - renderComponent(); - - await userEvent.click(screen.getByText('Open Drawer')); - - expect(screen.getByRole('drawer')).not.toHaveClass('hidden'); - expect(screen.getByRole('drawer')).toHaveClass('block'); - }); - - it('should open and close Drawer', async () => { - renderComponent(); - - await userEvent.click(screen.getByText('Open Drawer')); - - expect(screen.getByRole('drawer')).not.toHaveClass('hidden'); - expect(screen.getByRole('drawer')).toHaveClass('block'); - - await userEvent.click(screen.getByRole('close-drawer-button')); - - expect(screen.getByRole('drawer')).toHaveClass('hidden'); - expect(screen.getByRole('drawer')).not.toHaveClass('block'); - }); }); diff --git a/src/components/Map/Drawer/Drawer.component.tsx b/src/components/Map/Drawer/Drawer.component.tsx index 5d183be1e5986e707807b2a17b043afd91729076..b1b085ec361db7a1295fde9eccf62ca8b3782526 100644 --- a/src/components/Map/Drawer/Drawer.component.tsx +++ b/src/components/Map/Drawer/Drawer.component.tsx @@ -20,8 +20,8 @@ export const Drawer = (): JSX.Element | null => { <div className={twMerge( - 'absolute top-[104px] left-[88px] z-10 w-[432px] h-calc-drawer bg-white-pearl text-font-500 transition-all duration-500 transform -translate-x-full hidden', - open && 'translate-x-0 block', + 'absolute top-[104px] left-[88px] z-10 w-[432px] h-calc-drawer bg-white-pearl text-font-500 transition-all duration-500 transform -translate-x-full', + open && 'translate-x-0', )} role={drawerRole} >