Skip to content

Commit

Permalink
Merge pull request #296 from SchoodEIP/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Exiels authored Dec 4, 2024
2 parents d41ab6a + ebb960a commit 0339339
Show file tree
Hide file tree
Showing 58 changed files with 2,044 additions and 690 deletions.
64 changes: 60 additions & 4 deletions src/Components/Accounts/Adm/admAccountsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ import { toast } from 'react-toastify'
import DeleteAccountPopupContent from '../../Popup/deleteAccount'
import Popup from 'reactjs-popup'
import cross from '../../../assets/Cross.png'
import minusButton from '../../../assets/minus-button.png'
import deleteButton from '../../../assets/deleteIcon.png'
import suspendButton from '../../../assets/suspendIcon.png'
import restoreButton from '../../../assets/restoreIcon.png'

export default function AdmAccountsTable () {
const [accountList, setAccountList] = useState([]) // list of accounts

Check warning on line 13 in src/Components/Accounts/Adm/admAccountsTable.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const [isPopupOpen, setIsPopupOpen] = useState(false)

Check warning on line 14 in src/Components/Accounts/Adm/admAccountsTable.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const [userId, setUserId] = useState('')

Check warning on line 15 in src/Components/Accounts/Adm/admAccountsTable.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const [actionType, setActionType] = useState('delete')

Check warning on line 16 in src/Components/Accounts/Adm/admAccountsTable.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

async function getAccountList () {
const baseUrl = process.env.REACT_APP_BACKEND_URL + '/user/all'

Check warning on line 19 in src/Components/Accounts/Adm/admAccountsTable.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
Expand All @@ -28,6 +31,27 @@ export default function AdmAccountsTable () {
} else {
const data = await resp.json()

Check warning on line 32 in src/Components/Accounts/Adm/admAccountsTable.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
setAccountList(data)
getSuspendedAccountList(data)
}

Check warning on line 35 in src/Components/Accounts/Adm/admAccountsTable.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

async function getSuspendedAccountList (list) {
const baseUrl = process.env.REACT_APP_BACKEND_URL + '/user/getDisabled'
const token = sessionStorage.getItem('token')

const resp = await fetch(baseUrl, {
method: 'GET',
headers: {
'x-auth-token': token,
'Content-Type': 'application/json'
}
})
if (resp.status === 401) {
disconnect()
} else {
const data = await resp.json()
const array = [...list, ...data]
setAccountList(array)
}
}

Expand All @@ -39,7 +63,8 @@ export default function AdmAccountsTable () {
setIsPopupOpen(!isPopupOpen)
}

const callDeleteAccount = (userIdValue) => {
const callDeleteAccount = (userIdValue, action) => {
setActionType(action)
setUserId(userIdValue)
setIsPopupOpen(!isPopupOpen)
}
Expand All @@ -61,6 +86,7 @@ export default function AdmAccountsTable () {
if (resp.status === 401) {
disconnect()
} else if (resp.status === 200) {
setIsPopupOpen(false)
toast.success(deleteType ? 'Le compte a été supprimé' : 'Le compte a été suspendu')
getAccountList()
} else {
Expand All @@ -69,13 +95,36 @@ export default function AdmAccountsTable () {
}
}

async function activateAccount (accountId) {
const baseUrl = process.env.REACT_APP_BACKEND_URL + '/adm/activateUser/' + accountId
const token = sessionStorage.getItem('token')

const resp = await fetch(baseUrl, {
method: 'POST',
headers: {
'x-auth-token': token,
'Content-Type': 'application/json'
}
})
if (resp.status === 401) {
disconnect()
} else if (resp.status === 200) {
setIsPopupOpen(false)
toast.success('Le compte a été restauré')
getAccountList()
} else {
toast.error("une alerte s'est produite")
getAccountList()
}
}

return (
<div className='AccountsTable'>
<Popup open={isPopupOpen} onClose={openPopup} modal>
{(close) => (
<div className='popup-modal-container' style={{ alignItems: 'center' }}>
<button className='close-btn' onClick={close}><img src={cross} alt='Close' /></button>
<DeleteAccountPopupContent userIdValue={userId} deleteUserAccount={deleteAccount} closeDeleteAccountPopup={close} />
<DeleteAccountPopupContent userIdValue={userId} actionType={actionType} deleteUserAccount={deleteAccount} activateAccount={activateAccount} closeDeleteAccountPopup={close} />
</div>
)}
</Popup>
Expand All @@ -96,7 +145,14 @@ export default function AdmAccountsTable () {
<td>{data.firstname}</td>
<td>{data.lastname}</td>
<td>{data.email}</td>
<td><img data-testid='suspendBtn' className='suspendBtn' onClick={(e) => { e.stopPropagation(); callDeleteAccount(data._id) }} src={minusButton} alt='delete' title='Supprimer ou suspendre le compte' /></td>
<td className='action-td'>
{
data.active
? <img data-testid='suspendBtn' className='suspendBtn' onClick={(e) => { e.stopPropagation(); callDeleteAccount(data._id, 'suspend') }} src={suspendButton} alt='delete' title='Suspendre le compte' />
: <img data-testid='suspendBtn' className='suspendBtn' onClick={(e) => { e.stopPropagation(); callDeleteAccount(data._id, 'restore') }} src={restoreButton} alt='delete' title='Restaurer le compte' />
}
<img data-testid='suspendBtn' className='suspendBtn' onClick={(e) => { e.stopPropagation(); callDeleteAccount(data._id, 'delete') }} src={deleteButton} alt='delete' title='Supprimer le compte' />
</td>
</tr>
)
}
Expand Down
Loading

1 comment on commit 0339339

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

Caution

Coverage does not meet threshold
Statements coverage not met for global: expected >=80%, but got 0.47801147227533464%

St.
Category Percentage Covered / Total
🔴 Statements 0.48% 15/3138
🔴 Branches 0.96% 14/1460
🔴 Functions 0.11% 1/915
🔴 Lines 0.03% 1/3009

Test suite run failed

Failed tests: 0/8. Failed suites: 48/49.
  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Popup/alertCreation.test.jsx'

      2 | import '@testing-library/jest-dom'
      3 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 4 | import { BrowserRouter } from 'react-router-dom'
        | ^
      5 | import AlertCreationPopupContent from '../../../Components/Popup/alertCreation'
      6 | import fetchMock from 'fetch-mock'
      7 | import { disconnect } from '../../../functions/disconnect'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Popup/alertCreation.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Users/Teacher/modifyFormTeacherPage.jsx'

    Require stack:
      src/Users/Teacher/modifyFormTeacherPage.jsx
      src/__tests__/Users/Teacher/modifyFormTeacherPage.test.jsx

      1 | import React, { useState, useEffect } from 'react'
    > 2 | import { useParams } from 'react-router-dom'
        | ^
      3 | import moment from 'moment'
      4 | import DatePicker from 'react-datepicker'
      5 | import HeaderComp from '../../Components/Header/headerComp'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Users/Teacher/modifyFormTeacherPage.jsx:2:1)
      at Object.require (src/__tests__/Users/Teacher/modifyFormTeacherPage.test.jsx:5:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Users/Shared/teacherProfilePage.test.jsx'

      3 | import '@testing-library/jest-dom'
      4 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 5 | import { MemoryRouter, Routes, Route } from 'react-router-dom'
        | ^
      6 | import fetchMock from 'fetch-mock'
      7 | import TeacherProfilePage from '../../../Users/Shared/TeacherProfilePage'
      8 | import { disconnect } from '../../../functions/disconnect'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Users/Shared/teacherProfilePage.test.jsx:5:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/Teacher/newFormPage.jsx
      src/__tests__/Users/Teacher/newFormPage.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/Teacher/newFormPage.jsx:2:1)
      at Object.require (src/__tests__/Users/Teacher/newFormPage.test.jsx:5:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/SchoolAdmin/schoolAdmAccountsPage.js
      src/__tests__/Users/SchoolAdmin/schoolAdmAccountsPage.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/SchoolAdmin/schoolAdmAccountsPage.js:2:1)
      at Object.require (src/__tests__/Users/SchoolAdmin/schoolAdmAccountsPage.test.jsx:3:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/ChatRoom/chatRoom.test.jsx'

       5 | import '@testing-library/jest-dom/'
       6 | import { WebsocketProvider } from '../../../contexts/websocket'
    >  7 | import { MemoryRouter } from 'react-router-dom'
         | ^
       8 | import { disconnect } from '../../../functions/disconnect'
       9 |
      10 | jest.mock('../../../functions/disconnect', () => ({

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/ChatRoom/chatRoom.test.jsx:7:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/Admin/admAccountsPage.js
      src/__tests__/Users/Admin/admAccountsPage.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/Admin/admAccountsPage.js:2:1)
      at Object.require (src/__tests__/Users/Admin/admAccountsPage.test.jsx:3:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Accounts/SchoolAdm/schoolAdmAccountsTable.test.jsx'

      3 | import SchoolAccountsTable from '../../../../Components/Accounts/SchoolAdm/schoolAccountsTable'
      4 | import { WebsocketProvider } from '../../../../contexts/websocket'
    > 5 | import { BrowserRouter } from 'react-router-dom'
        | ^
      6 | import fetchMock from 'fetch-mock'
      7 | import { disconnect } from '../../../../functions/disconnect'
      8 |

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Accounts/SchoolAdm/schoolAdmAccountsTable.test.jsx:5:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Users/Shared/alertsPage.jsx'

    Require stack:
      src/Users/Shared/alertsPage.jsx
      src/__tests__/Users/Shared/alertsPage.test.jsx

      1 | import React, { useState, useEffect } from 'react'
    > 2 | import { useParams } from 'react-router-dom'
        | ^
      3 | import ShowAlerts from '../../Components/Alerts/showAlerts'
      4 | import HeaderComp from '../../Components/Header/headerComp'
      5 | import Popup from 'reactjs-popup'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Users/Shared/alertsPage.jsx:2:1)
      at Object.require (src/__tests__/Users/Shared/alertsPage.test.jsx:2:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/SchoolAdmin/reportChecking.jsx
      src/__tests__/Users/SchoolAdmin/reportChecking.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/SchoolAdmin/reportChecking.jsx:4:1)
      at Object.require (src/__tests__/Users/SchoolAdmin/reportChecking.test.jsx:1:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/Shared/helpPage.jsx
      src/__tests__/Users/Shared/helpPage.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/Shared/helpPage.jsx:4:1)
      at Object.require (src/__tests__/Users/Shared/helpPage.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Users/Student/formStudentPage.jsx'

    Require stack:
      src/Users/Student/formStudentPage.jsx
      src/__tests__/Users/Student/formStudentPage.test.jsx

      1 | import React, { useEffect, useState } from 'react'
    > 2 | import { useNavigate, useParams } from 'react-router-dom'
        | ^
      3 | import { toast } from 'react-toastify'
      4 | import moment from 'moment'
      5 | import HeaderComp from '../../Components/Header/headerComp'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Users/Student/formStudentPage.jsx:2:1)
      at Object.require (src/__tests__/Users/Student/formStudentPage.test.jsx:5:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/ChatRoom/createConversationPopup.test.jsx'

       5 | import '@testing-library/jest-dom/'
       6 | import { WebsocketProvider } from '../../../contexts/websocket'
    >  7 | import { BrowserRouter } from 'react-router-dom'
         | ^
       8 |
       9 | describe('createConversationPopup Component', () => {
      10 |   const id = 123

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/ChatRoom/createConversationPopup.test.jsx:7:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Users/Teacher/formTeacherPage.jsx'

    Require stack:
      src/Users/Teacher/formTeacherPage.jsx
      src/__tests__/Users/Teacher/formTeacherPage.test.jsx

      1 | import React, { useState, useEffect } from 'react'
    > 2 | import { useParams } from 'react-router-dom'
        | ^
      3 | import moment from 'moment'
      4 | import HeaderComp from '../../Components/Header/headerComp'
      5 | import TeacherFormContent from '../../Components/Questionnaire/teacherFormContent'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Users/Teacher/formTeacherPage.jsx:2:1)
      at Object.require (src/__tests__/Users/Teacher/formTeacherPage.test.jsx:5:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/Student/feelingsStudentPage.jsx
      src/__tests__/Users/Student/feelingStudentPage.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/Student/feelingsStudentPage.jsx:4:1)
      at Object.require (src/__tests__/Users/Student/feelingStudentPage.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/ChatRoom/reportButton.test.jsx'

      4 | import ReportButton from '../../../Components/ChatRoom/reportButton'
      5 | import fetchMock from 'fetch-mock'
    > 6 | import { BrowserRouter } from 'react-router-dom'
        | ^
      7 | import { WebsocketProvider } from '../../../contexts/websocket'
      8 | import { disconnect } from '../../../functions/disconnect'
      9 |

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/ChatRoom/reportButton.test.jsx:6:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Accounts/Adm/admAccountsTable.test.jsx'

      3 | import AdmAccountsTable from '../../../../Components/Accounts/Adm/admAccountsTable'
      4 | import { WebsocketProvider } from '../../../../contexts/websocket'
    > 5 | import { BrowserRouter } from 'react-router-dom'
        | ^
      6 | import fetchMock from 'fetch-mock'
      7 | import { disconnect } from '../../../../functions/disconnect'
      8 |

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Accounts/Adm/admAccountsTable.test.jsx:5:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Questionnaire/questSpace.jsx'

    Require stack:
      src/Components/Questionnaire/questSpace.jsx
      src/__tests__/Components/Questionnaire/questSpace.test.jsx

      1 | import React, { useEffect, useState } from 'react'
      2 | import '../../css/Components/Questionnaire/questSpace.scss'
    > 3 | import { Link, useNavigate } from 'react-router-dom'
        | ^
      4 | import rightArrowInverted from '../../assets/right-arrow-inverted.png'
      5 | import { disconnect } from '../../functions/disconnect'
      6 |

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Questionnaire/questSpace.jsx:3:1)
      at Object.require (src/__tests__/Components/Questionnaire/questSpace.test.jsx:2:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Sidebar/sidebar.test.jsx'

      1 | import React from 'react'
      2 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 3 | import { BrowserRouter } from 'react-router-dom'
        | ^
      4 | import Sidebar from '../../../Components/Sidebar/sidebar'
      5 | import { render, fireEvent, screen, act, waitFor } from '@testing-library/react'
      6 | import '@testing-library/jest-dom'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Sidebar/sidebar.test.jsx:3:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Profil/profileComp.test.jsx'

      4 | import fetchMock from 'fetch-mock'
      5 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 6 | import { MemoryRouter } from 'react-router-dom'
        | ^
      7 | import { disconnect } from '../../../functions/disconnect'
      8 | import ProfileComp from '../../../Components/Profil/profileComp'
      9 |

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Profil/profileComp.test.jsx:6:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Alerts/lastAlerts.test.jsx'

      3 | import { render, screen, act, waitFor } from '@testing-library/react'
      4 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 5 | import { BrowserRouter } from 'react-router-dom'
        | ^
      6 | import fetchMock from 'fetch-mock'
      7 | import { LastAlerts } from '../../../Components/Alerts/lastAlerts'
      8 | import { disconnect } from '../../../functions/disconnect'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Alerts/lastAlerts.test.jsx:5:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Popup/reportCreation.test.jsx'

      2 | import '@testing-library/jest-dom'
      3 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 4 | import { BrowserRouter } from 'react-router-dom'
        | ^
      5 | import ReportCreationPopupContent from '../../../Components/Popup/reportCreation'
      6 | import fetchMock from 'fetch-mock'
      7 | import { disconnect } from '../../../functions/disconnect'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Popup/reportCreation.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Users/Public/loginPage.test.jsx'

      3 | import Login from '../../../Users/Public/loginPage'
      4 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 5 | import { BrowserRouter } from 'react-router-dom'
        | ^
      6 | import fetchMock from 'fetch-mock'
      7 |
      8 | describe('Connexion', () => {

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Users/Public/loginPage.test.jsx:5:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/ChatRoom/chatRoomSidebar.test.jsx'

      4 | import '@testing-library/jest-dom/'
      5 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 6 | import { BrowserRouter } from 'react-router-dom'
        | ^
      7 |
      8 | describe('ChatRoomSidebar', () => {
      9 |   const conversations = [

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/ChatRoom/chatRoomSidebar.test.jsx:6:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Profil/profilPage.jsx'

    Require stack:
      src/Components/Profil/profilPage.jsx
      src/Users/Shared/profilPage.jsx
      src/__tests__/Users/Shared/profilPage.test.jsx

      1 | import React, { useEffect, useState } from 'react'
    > 2 | import { useNavigate } from 'react-router-dom'
        | ^
      3 | import '../../css/pages/profilPage.scss'
      4 | import userIcon from '../../assets/userIcon.png'
      5 | import Popup from 'reactjs-popup'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Profil/profilPage.jsx:2:1)
      at Object.require (src/Users/Shared/profilPage.jsx:2:1)
      at Object.require (src/__tests__/Users/Shared/profilPage.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/ChatRoom/message.test.jsx'

      4 | import '@testing-library/jest-dom/'
      5 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 6 | import { BrowserRouter } from 'react-router-dom'
        | ^
      7 | import { disconnect } from '../../../functions/disconnect'
      8 |
      9 | jest.mock('../../../functions/disconnect', () => ({

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/ChatRoom/message.test.jsx:6:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/Teacher/statisticsTeacher.jsx
      src/__tests__/Users/Teacher/statisticsTeacher.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/Teacher/statisticsTeacher.jsx:2:1)
      at Object.require (src/__tests__/Users/Teacher/statisticsTeacher.test.jsx:3:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Popup/helpNumberCreation.test.jsx'

      2 | import '@testing-library/jest-dom'
      3 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 4 | import { BrowserRouter } from 'react-router-dom'
        | ^
      5 | import HelpNumberCreationPopupContent from '../../../Components/Popup/helpNumberCreation'
      6 | import fetchMock from 'fetch-mock'
      7 | import { disconnect } from '../../../functions/disconnect'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Popup/helpNumberCreation.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Popup/moodFormCreation.test.jsx'

      2 | import '@testing-library/jest-dom'
      3 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 4 | import { BrowserRouter } from 'react-router-dom'
        | ^
      5 | import MoodFormCreationPopupContent from '../../../Components/Popup/moodFormCreation'
      6 | import fetchMock from 'fetch-mock'
      7 | import { disconnect } from '../../../functions/disconnect'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Popup/moodFormCreation.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Profil/statComp.test.jsx'

      4 | import fetchMock from 'fetch-mock'
      5 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 6 | import { MemoryRouter } from 'react-router-dom'
        | ^
      7 | import { disconnect } from '../../../functions/disconnect'
      8 | import StatComp from '../../../Components/Profil/statComp'
      9 |

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Profil/statComp.test.jsx:6:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Users/Public/forgottenPasswordPage.test.jsx'

      4 | import { render, act, fireEvent, waitFor, screen } from '@testing-library/react'
      5 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 6 | import { BrowserRouter } from 'react-router-dom'
        | ^
      7 |
      8 | describe('ForgottenPasswordPage', () => {
      9 |   beforeEach(() => {

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Users/Public/forgottenPasswordPage.test.jsx:6:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Users/Student/statisticsStudent.test.jsx'

      1 | import React from 'react'
      2 | import { render, screen, fireEvent, act, waitFor } from '@testing-library/react'
    > 3 | import { MemoryRouter } from 'react-router-dom'
        | ^
      4 | import StudentStatPage from '../../../Users/Student/statisticsStudent'
      5 | import fetchMock from 'fetch-mock'
      6 | import { disconnect } from '../../../functions/disconnect'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Users/Student/statisticsStudent.test.jsx:3:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/Teacher/formListTeacherPage.jsx
      src/__tests__/Users/Teacher/formListTeacherPage.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/Teacher/formListTeacherPage.jsx:2:1)
      at Object.require (src/__tests__/Users/Teacher/formListTeacherPage.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/Student/formListStudentPage.jsx
      src/__tests__/Users/Student/formListStudentPage.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/Student/formListStudentPage.jsx:2:1)
      at Object.require (src/__tests__/Users/Student/formListStudentPage.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Header/header.test.jsx'

      2 | import '@testing-library/jest-dom'
      3 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 4 | import { BrowserRouter } from 'react-router-dom'
        | ^
      5 | import HeaderComp from '../../../Components/Header/headerComp'
      6 | // import { disconnect } from '../../../functions/disconnect'
      7 | import fetchMock from 'fetch-mock'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Header/header.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/Shared/helpPage.jsx
      src/__tests__/Components/Aides/aides.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/Shared/helpPage.jsx:4:1)
      at Object.require (src/__tests__/Components/Aides/aides.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/Student/dashboardStudent.jsx
      src/__tests__/Users/Student/dashboardStudent.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/Student/dashboardStudent.jsx:2:1)
      at Object.require (src/__tests__/Users/Student/dashboardStudent.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Alerts/showAlert.test.jsx'

      3 | import { render, screen, act, waitFor } from '@testing-library/react'
      4 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 5 | import { BrowserRouter } from 'react-router-dom'
        | ^
      6 | import ShowAlerts from '../../../Components/Alerts/showAlerts'
      7 |
      8 | describe('ShowAlerts component', () => {

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Alerts/showAlert.test.jsx:5:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Profil/feelingsComp.test.jsx'

      4 | import fetchMock from 'fetch-mock'
      5 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 6 | import { MemoryRouter } from 'react-router-dom'
        | ^
      7 | import { disconnect } from '../../../functions/disconnect'
      8 | import FeelingsComp from '../../../Components/Profil/feelingsComp'
      9 |

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Profil/feelingsComp.test.jsx:6:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Profil/reportComp.test.jsx'

      4 | import fetchMock from 'fetch-mock'
      5 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 6 | import { MemoryRouter } from 'react-router-dom'
        | ^
      7 | import { disconnect } from '../../../functions/disconnect'
      8 | import ReportComp from '../../../Components/Profil/reportComp'
      9 |

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Profil/reportComp.test.jsx:6:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Reports/reportSidebar.test.jsx'

      4 | import ReportSidebar from '../../../Components/reports/reportSidebar'
      5 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 6 | import { BrowserRouter } from 'react-router-dom'
        | ^
      7 | import fetchMock from 'fetch-mock'
      8 |
      9 | describe('Feelings Component', () => {

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Reports/reportSidebar.test.jsx:6:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Popup/categoryCreation.test.jsx'

      2 | import '@testing-library/jest-dom'
      3 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 4 | import { BrowserRouter } from 'react-router-dom'
        | ^
      5 | import CategoryCreationPopupContent from '../../../Components/Popup/categoryCreation'
      6 | import fetchMock from 'fetch-mock'
      7 | import { disconnect } from '../../../functions/disconnect'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Popup/categoryCreation.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/SchoolAdmin/schoolAdmHomePage.jsx
      src/__tests__/Users/SchoolAdmin/schoolAdmHomePage.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/SchoolAdmin/schoolAdmHomePage.jsx:2:1)
      at Object.require (src/__tests__/Users/SchoolAdmin/schoolAdmHomePage.test.jsx:3:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/__tests__/Components/Buttons/previousPage.test.jsx'

      2 | import { createMemoryHistory } from 'history'
      3 | import { WebsocketProvider } from '../../../contexts/websocket'
    > 4 | import { BrowserRouter } from 'react-router-dom'
        | ^
      5 | import '@testing-library/jest-dom'
      6 | import PreviousPage from '../../../Components/Buttons/previousPage'
      7 |

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/__tests__/Components/Buttons/previousPage.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Buttons/previousPage.jsx'

    Require stack:
      src/Components/Buttons/previousPage.jsx
      src/Users/Public/noPage.jsx
      src/__tests__/Users/Public/noPage.test.js

      1 | import { React } from 'react'
    > 2 | import { useNavigate } from 'react-router-dom'
        | ^
      3 | import '../../css/Components/Buttons/button.css'
      4 |
      5 | export default function PreviousPage () {

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Buttons/previousPage.jsx:2:1)
      at Object.require (src/Users/Public/noPage.jsx:3:1)
      at Object.require (src/__tests__/Users/Public/noPage.test.js:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/Teacher/dashboardTeacher.jsx
      src/__tests__/Users/Teacher/dashboardTeacher.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/Teacher/dashboardTeacher.jsx:2:1)
      at Object.require (src/__tests__/Users/Teacher/dashboardTeacher.test.jsx:4:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/Admin/admHomePage.jsx
      src/__tests__/Users/Admin/admHomePage.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/Admin/admHomePage.jsx:2:1)
      at Object.require (src/__tests__/Users/Admin/admHomePage.test.jsx:3:1)


  ● Test suite failed to run

    Cannot find module 'react-router-dom' from 'src/Components/Header/headerComp.js'

    Require stack:
      src/Components/Header/headerComp.js
      src/Users/Shared/chatRoomPage.jsx
      src/__tests__/Components/ChatRoom/chatRoomPage.test.jsx

      2 | import backButton from '../../assets/backButton.png'
      3 | import '../../css/Components/Header/headerComp.scss'
    > 4 | import { useNavigate, useLocation, Link } from 'react-router-dom'
        | ^
      5 | import { WebsocketContext } from '../../contexts/websocket'
      6 | import Popup from 'reactjs-popup'
      7 | import moment from 'moment'

      at Resolver.resolveModule (node_modules/react-scripts/node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.require (src/Components/Header/headerComp.js:4:1)
      at Object.require (src/Users/Shared/chatRoomPage.jsx:2:1)
      at Object.require (src/__tests__/Components/ChatRoom/chatRoomPage.test.jsx:4:1)

Report generated by 🧪jest coverage report action from 0339339

Please sign in to comment.