diff --git a/hotel-management/package.json b/hotel-management/package.json index 2e05cd6..9c8d398 100644 --- a/hotel-management/package.json +++ b/hotel-management/package.json @@ -19,14 +19,12 @@ "@supabase/supabase-js": "^2.38.4", "@tanstack/react-query": "^5.8.4", "@tanstack/react-query-devtools": "^5.8.4", - "@types/react-test-renderer": "^18.0.6", "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.47.0", "react-hot-toast": "^2.4.1", "react-icons": "^4.11.0", "react-router-dom": "^6.17.0", - "react-test-renderer": "^18.2.0", "styled-components": "^6.1.0" }, "devDependencies": { diff --git a/hotel-management/pnpm-lock.yaml b/hotel-management/pnpm-lock.yaml index 1ea06fe..72ff2fd 100644 --- a/hotel-management/pnpm-lock.yaml +++ b/hotel-management/pnpm-lock.yaml @@ -17,9 +17,6 @@ dependencies: '@tanstack/react-query-devtools': specifier: ^5.8.4 version: 5.8.4(@tanstack/react-query@5.8.4)(react-dom@18.2.0)(react@18.2.0) - '@types/react-test-renderer': - specifier: ^18.0.6 - version: 18.0.6 react: specifier: ^18.2.0 version: 18.2.0 @@ -38,9 +35,6 @@ dependencies: react-router-dom: specifier: ^6.17.0 version: 6.17.0(react-dom@18.2.0)(react@18.2.0) - react-test-renderer: - specifier: ^18.2.0 - version: 18.2.0(react@18.2.0) styled-components: specifier: ^6.1.0 version: 6.1.0(react-dom@18.2.0)(react@18.2.0) @@ -1342,6 +1336,7 @@ packages: /@types/prop-types@15.7.9: resolution: {integrity: sha512-n1yyPsugYNSmHgxDFjicaI2+gCNjsBck8UX9kuofAKlc0h1bL+20oSF72KeNaW2DUlesbEVCFgyV2dPGTiY42g==} + dev: true /@types/react-dom@18.2.14: resolution: {integrity: sha512-V835xgdSVmyQmI1KLV2BEIUgqEuinxp9O4G6g3FqO/SqLac049E53aysv0oEFD2kHfejeKU+ZqL2bcFWj9gLAQ==} @@ -1349,21 +1344,17 @@ packages: '@types/react': 18.2.29 dev: true - /@types/react-test-renderer@18.0.6: - resolution: {integrity: sha512-O2JT1J3/v/NaYHYmPf2DXBSqUGmp6iwhFPicES6Pc1Y90B9Qgu99mmaBGqfZFpVuXLzF/pNJB4K9ySL3iqFeXA==} - dependencies: - '@types/react': 18.2.29 - dev: false - /@types/react@18.2.29: resolution: {integrity: sha512-Z+ZrIRocWtdD70j45izShRwDuiB4JZqDegqMFW/I8aG5DxxLKOzVNoq62UIO82v9bdgi+DO1jvsb9sTEZUSm+Q==} dependencies: '@types/prop-types': 15.7.9 '@types/scheduler': 0.16.5 csstype: 3.1.2 + dev: true /@types/scheduler@0.16.5: resolution: {integrity: sha512-s/FPdYRmZR8SjLWGMCuax7r3qCWQw9QKHzXVukAuuIJkXkDRwp+Pu5LMIVFi0Fxbav35WURicYr8u1QsoybnQw==} + dev: true /@types/semver@7.5.3: resolution: {integrity: sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw==} @@ -3738,11 +3729,6 @@ packages: resolution: {integrity: sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==} dev: true - /object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - dev: false - /object-inspect@1.13.1: resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} dev: true @@ -4005,6 +3991,7 @@ packages: /react-is@18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + dev: true /react-refresh@0.14.0: resolution: {integrity: sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==} @@ -4034,27 +4021,6 @@ packages: react: 18.2.0 dev: false - /react-shallow-renderer@16.15.0(react@18.2.0): - resolution: {integrity: sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==} - peerDependencies: - react: ^16.0.0 || ^17.0.0 || ^18.0.0 - dependencies: - object-assign: 4.1.1 - react: 18.2.0 - react-is: 18.2.0 - dev: false - - /react-test-renderer@18.2.0(react@18.2.0): - resolution: {integrity: sha512-JWD+aQ0lh2gvh4NM3bBM42Kx+XybOxCpgYK7F8ugAlpaTSnWsX+39Z4XkOykGZAHrjwwTZT3x3KxswVWxHPUqA==} - peerDependencies: - react: ^18.2.0 - dependencies: - react: 18.2.0 - react-is: 18.2.0 - react-shallow-renderer: 16.15.0(react@18.2.0) - scheduler: 0.23.0 - dev: false - /react@18.2.0: resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} engines: {node: '>=0.10.0'} diff --git a/hotel-management/src/App.test.tsx b/hotel-management/src/App.test.tsx index ec995a5..761b4f7 100644 --- a/hotel-management/src/App.test.tsx +++ b/hotel-management/src/App.test.tsx @@ -1,6 +1,10 @@ import { render, act, RenderResult } from '@testing-library/react'; + +// Services import * as userServices from '@service/userServices'; import * as roomServices from '@service/roomServices'; + +// Components import App from './App'; jest.mock('@service/userServices'); diff --git a/hotel-management/src/App.tsx b/hotel-management/src/App.tsx index f650215..534dbb3 100644 --- a/hotel-management/src/App.tsx +++ b/hotel-management/src/App.tsx @@ -14,7 +14,7 @@ import RootLayout from '@component/RootLayout'; import User from './pages/User'; import Booking from './pages/Booking'; import Room from './pages/Room'; -import NotFound from './pages/NotFound/NotFound'; +import NotFound from './pages/NotFound'; import Login from '@page/Login'; import Account from '@page/Account'; diff --git a/hotel-management/src/__snapshots__/App.test.tsx.snap b/hotel-management/src/__snapshots__/App.test.tsx.snap index 5cbca46..f64b3ec 100644 --- a/hotel-management/src/__snapshots__/App.test.tsx.snap +++ b/hotel-management/src/__snapshots__/App.test.tsx.snap @@ -9,7 +9,7 @@ exports[`App should render correctly 1`] = ` class="sc-jrsKJM iDdaat" >
{ const queryClient = new QueryClient(); - const wrapper = renderer.create( + const wrapper = render( diff --git a/hotel-management/src/components/AppLayout/__snapshots__/AppLayout.test.tsx.snap b/hotel-management/src/components/AppLayout/__snapshots__/AppLayout.test.tsx.snap index a1bf590..45eb3ab 100644 --- a/hotel-management/src/components/AppLayout/__snapshots__/AppLayout.test.tsx.snap +++ b/hotel-management/src/components/AppLayout/__snapshots__/AppLayout.test.tsx.snap @@ -1,208 +1,360 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`AppLayout Should render correctly 1`] = ` -
-
-

- Hi, - ! -

-
    -
  • - -
  • -
  • - +
  • +
  • + +
  • +
+
+
+
+ , + "container":
+ + + + + + + Booking + + + + + + User + + + + + + + + Room + + + + +
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; diff --git a/hotel-management/src/components/AppLayout/styled.ts b/hotel-management/src/components/AppLayout/styled.ts index 90bbd79..364793b 100644 --- a/hotel-management/src/components/AppLayout/styled.ts +++ b/hotel-management/src/components/AppLayout/styled.ts @@ -4,7 +4,7 @@ const StyledAppLayout = styled.div` display: grid; grid-template-columns: 300px 1fr; grid-template-rows: auto 1fr; - + height: 100vh; `; diff --git a/hotel-management/src/components/ButtonIcon/ButtonIcon.test.tsx b/hotel-management/src/components/ButtonIcon/ButtonIcon.test.tsx index d656e68..2ba19a9 100644 --- a/hotel-management/src/components/ButtonIcon/ButtonIcon.test.tsx +++ b/hotel-management/src/components/ButtonIcon/ButtonIcon.test.tsx @@ -1,11 +1,11 @@ -import renderer from 'react-test-renderer'; - -// Components -import ButtonIcon from '.'; import { HiOutlineLogout } from 'react-icons/hi'; +// Components +import { render } from '@testing-library/react'; +import ButtonIcon from '.'; + describe('ButtonIcon', () => { - const wrapper = renderer.create( + const wrapper = render( } diff --git a/hotel-management/src/components/ButtonIcon/__snapshots__/ButtonIcon.test.tsx.snap b/hotel-management/src/components/ButtonIcon/__snapshots__/ButtonIcon.test.tsx.snap index c125584..12e3a40 100644 --- a/hotel-management/src/components/ButtonIcon/__snapshots__/ButtonIcon.test.tsx.snap +++ b/hotel-management/src/components/ButtonIcon/__snapshots__/ButtonIcon.test.tsx.snap @@ -1,44 +1,110 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ButtonIcon Should render correctly 1`] = ` - +{ + "asFragment": [Function], + "baseElement": +
+ +
+ , + "container":
+ +
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; diff --git a/hotel-management/src/components/ConfirmMessage/ConfirmMessage.test.tsx b/hotel-management/src/components/ConfirmMessage/ConfirmMessage.test.tsx index e389c7a..38054eb 100644 --- a/hotel-management/src/components/ConfirmMessage/ConfirmMessage.test.tsx +++ b/hotel-management/src/components/ConfirmMessage/ConfirmMessage.test.tsx @@ -1,6 +1,7 @@ +import { RenderResult, fireEvent, render } from '@testing-library/react'; + // Components import ConfirmMessage from '.'; -import { RenderResult, fireEvent, render } from '@testing-library/react'; describe('ConfirmMessage testing snapshot', () => { const message = 'Hello World!'; diff --git a/hotel-management/src/components/Form/Form.test.tsx b/hotel-management/src/components/Form/Form.test.tsx index 7e248e6..783d197 100644 --- a/hotel-management/src/components/Form/Form.test.tsx +++ b/hotel-management/src/components/Form/Form.test.tsx @@ -1,7 +1,9 @@ -import renderer from 'react-test-renderer'; +import { render } from '@testing-library/react'; // Components import Form from '.'; + +// Styled import Input from '@commonStyle/Input'; describe('Form ', () => { @@ -10,7 +12,7 @@ describe('Form ', () => { const handleOnSubmit = jest.fn(); const handleOnClick = jest.fn(); - const wrapper = renderer.create( + const wrapper = render(
@@ -24,7 +26,11 @@ describe('Form ', () => { Confirm - + Close diff --git a/hotel-management/src/components/Form/__snapshots__/Form.test.tsx.snap b/hotel-management/src/components/Form/__snapshots__/Form.test.tsx.snap index b3c34ce..4653096 100644 --- a/hotel-management/src/components/Form/__snapshots__/Form.test.tsx.snap +++ b/hotel-management/src/components/Form/__snapshots__/Form.test.tsx.snap @@ -1,74 +1,200 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Form Should render correctly 1`] = ` - -
- +{ + "asFragment": [Function], + "baseElement":
- -

- This is error message -

+
+ +
+ +

+ This is error message +

+
+
+
+ +
+ +

+ This is error message +

+
+
+
+ + +
+
-
-
-
+
+ +
+ +

+ This is error message +

+
+
+
+ + +
+ + , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; diff --git a/hotel-management/src/components/Header/Header.test.tsx b/hotel-management/src/components/Header/Header.test.tsx index 372a9d3..bb3d89a 100644 --- a/hotel-management/src/components/Header/Header.test.tsx +++ b/hotel-management/src/components/Header/Header.test.tsx @@ -1,14 +1,14 @@ -import renderer from 'react-test-renderer'; +import { render } from '@testing-library/react'; +import { BrowserRouter } from 'react-router-dom'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; // Components import Header from '.'; -import { BrowserRouter } from 'react-router-dom'; -import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; describe('Header', () => { const queryClient = new QueryClient(); - const wrapper = renderer.create( + const wrapper = render(
diff --git a/hotel-management/src/components/Header/__snapshots__/Header.test.tsx.snap b/hotel-management/src/components/Header/__snapshots__/Header.test.tsx.snap index 7fec964..656178a 100644 --- a/hotel-management/src/components/Header/__snapshots__/Header.test.tsx.snap +++ b/hotel-management/src/components/Header/__snapshots__/Header.test.tsx.snap @@ -1,106 +1,194 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Header Should render correctly 1`] = ` -
-

- Hi, - Nezumi - ! -

-
    -
  • - -
  • -
  • - +
  • +
  • + +
  • +
+
+ + , + "container":
+
+

+ Hi, + Nezumi + ! +

+
    - - - - - -
-
+
  • + +
  • +
  • + +
  • + +
    + , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; diff --git a/hotel-management/src/components/Header/styled.ts b/hotel-management/src/components/Header/styled.ts index 9ba8124..fcb68b3 100644 --- a/hotel-management/src/components/Header/styled.ts +++ b/hotel-management/src/components/Header/styled.ts @@ -2,7 +2,7 @@ import styled from 'styled-components'; const StyledHeader = styled.header` border-bottom: 1px solid var(--border-color); - + padding: 20px 40px; display: flex; diff --git a/hotel-management/src/components/HeaderMenu/HeaderMenu.test.tsx b/hotel-management/src/components/HeaderMenu/HeaderMenu.test.tsx index cafb5fc..8748ebb 100644 --- a/hotel-management/src/components/HeaderMenu/HeaderMenu.test.tsx +++ b/hotel-management/src/components/HeaderMenu/HeaderMenu.test.tsx @@ -1,14 +1,14 @@ -import renderer from 'react-test-renderer'; +import { BrowserRouter } from 'react-router-dom'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { render } from '@testing-library/react'; // Components import HeaderMenu from '.'; -import { BrowserRouter } from 'react-router-dom'; -import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; describe('HeaderMenu', () => { const queryClient = new QueryClient(); - const wrapper = renderer.create( + const wrapper = render( diff --git a/hotel-management/src/components/HeaderMenu/__snapshots__/HeaderMenu.test.tsx.snap b/hotel-management/src/components/HeaderMenu/__snapshots__/HeaderMenu.test.tsx.snap index 9740145..c88ef2e 100644 --- a/hotel-management/src/components/HeaderMenu/__snapshots__/HeaderMenu.test.tsx.snap +++ b/hotel-management/src/components/HeaderMenu/__snapshots__/HeaderMenu.test.tsx.snap @@ -1,97 +1,176 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`HeaderMenu Should render correctly 1`] = ` -
      -
    • - -
    • -
    • - +
    • +
    • + +
    • +
    + + , + "container":
    +
      - - - - - -
    +
  • + +
  • +
  • + +
  • + +
    , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; diff --git a/hotel-management/src/components/Menus/Menus.test.tsx b/hotel-management/src/components/Menus/Menus.test.tsx index 781e901..90fd77a 100644 --- a/hotel-management/src/components/Menus/Menus.test.tsx +++ b/hotel-management/src/components/Menus/Menus.test.tsx @@ -1,8 +1,9 @@ -// Components -import Menus from '.'; import { RiEditBoxFill, RiDeleteBin2Line } from 'react-icons/ri'; import { RenderResult, fireEvent, render } from '@testing-library/react'; +// Components +import Menus from '.'; + describe('Menus', () => { const id = '123'; const handleOnClick = jest.fn(); diff --git a/hotel-management/src/components/Menus/index.tsx b/hotel-management/src/components/Menus/index.tsx index 70bf25f..b6e1909 100644 --- a/hotel-management/src/components/Menus/index.tsx +++ b/hotel-management/src/components/Menus/index.tsx @@ -2,13 +2,17 @@ import { MouseEvent, ReactNode, useContext, useState } from 'react'; // Components import { HiEllipsisVertical } from 'react-icons/hi2'; +import ButtonIcon from '@component/ButtonIcon'; // Hooks import { useOutsideClick } from '@hook/useOutsideClick'; -import ButtonIcon from '@component/ButtonIcon'; // Styled -import { StyledMenu, StyledList, StyledToggle } from './styled'; +import { + StyledMenu, + StyledList, + StyledToggle +} from './styled'; // Contexts import MenusContext from '@context/MenuContext'; diff --git a/hotel-management/src/components/Message/Message.test.tsx b/hotel-management/src/components/Message/Message.test.tsx index 0aa2d76..660b276 100644 --- a/hotel-management/src/components/Message/Message.test.tsx +++ b/hotel-management/src/components/Message/Message.test.tsx @@ -1,10 +1,10 @@ -import renderer from 'react-test-renderer'; +import { render } from '@testing-library/react'; // Components import Message from '.'; describe('Message', () => { - const wrapper = renderer.create(This is a message!); + const wrapper = render(This is a message!); test('Should render correctly', () => { expect(wrapper).toMatchSnapshot(); diff --git a/hotel-management/src/components/Message/__snapshots__/Message.test.tsx.snap b/hotel-management/src/components/Message/__snapshots__/Message.test.tsx.snap index b817e31..b53b60e 100644 --- a/hotel-management/src/components/Message/__snapshots__/Message.test.tsx.snap +++ b/hotel-management/src/components/Message/__snapshots__/Message.test.tsx.snap @@ -1,9 +1,74 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Message Should render correctly 1`] = ` -

    - This is a message! -

    +{ + "asFragment": [Function], + "baseElement": +
    +

    + This is a message! +

    +
    + , + "container":
    +

    + This is a message! +

    +
    , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; diff --git a/hotel-management/src/components/Modal/Modal.test.tsx b/hotel-management/src/components/Modal/Modal.test.tsx index 7e17f35..5c43801 100644 --- a/hotel-management/src/components/Modal/Modal.test.tsx +++ b/hotel-management/src/components/Modal/Modal.test.tsx @@ -1,11 +1,11 @@ -import renderer from 'react-test-renderer'; +import { render } from '@testing-library/react'; // Components import Modal from '.'; import Button from '@commonStyle/Button'; describe('Modal', () => { - const wrapper = renderer.create( + const wrapper = render( - Add room - +{ + "asFragment": [Function], + "baseElement": +
    + +
    + , + "container":
    + +
    , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; diff --git a/hotel-management/src/components/Nav/Nav.test.tsx b/hotel-management/src/components/Nav/Nav.test.tsx index 6436c79..7747d44 100644 --- a/hotel-management/src/components/Nav/Nav.test.tsx +++ b/hotel-management/src/components/Nav/Nav.test.tsx @@ -1,11 +1,12 @@ -import renderer from 'react-test-renderer'; + +import { render } from '@testing-library/react'; import { BrowserRouter } from 'react-router-dom'; // Components import Nav from '.'; describe('Nav', () => { - const wrapper = renderer.create( + const wrapper = render( + + , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; diff --git a/hotel-management/src/components/SortBy/SortBy.test.tsx b/hotel-management/src/components/SortBy/SortBy.test.tsx index 28b6454..9c04095 100644 --- a/hotel-management/src/components/SortBy/SortBy.test.tsx +++ b/hotel-management/src/components/SortBy/SortBy.test.tsx @@ -1,6 +1,7 @@ import { BrowserRouter } from 'react-router-dom'; import { useState } from 'react'; import { render, fireEvent, RenderResult } from '@testing-library/react'; + // Components import SortBy from '.'; diff --git a/hotel-management/src/components/SortBy/__snapshots__/SortBy.test.tsx.snap b/hotel-management/src/components/SortBy/__snapshots__/SortBy.test.tsx.snap index 40bcf6f..2fbdfbe 100644 --- a/hotel-management/src/components/SortBy/__snapshots__/SortBy.test.tsx.snap +++ b/hotel-management/src/components/SortBy/__snapshots__/SortBy.test.tsx.snap @@ -10,13 +10,11 @@ exports[`SortBy Should render correctly 1`] = ` class="sc-bdnyFh hPOEsG" >