Refactor components to remove unused imports, enhance code readabilit… #172
Annotations
10 errors and 2 warnings
src/__test__/AddImagesCarouselDialog.test.jsx > AddImagesCarouselDialog Component > renders AddImagesCarouselDialog with correct elements:
frontend/src/components/shared/AddImagesCarouselDialog.jsx#L53
TypeError: Cannot destructure property 'showSnack' of 'useSnackbar(...)' as it is undefined.
❯ AddImagesCarouselDialog src/components/shared/AddImagesCarouselDialog.jsx:53:13
❯ renderWithHooks node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:15486:18
❯ mountIndeterminateComponent node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:20103:13
❯ beginWork node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:21626:16
❯ beginWork$1 node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27465:14
❯ performUnitOfWork node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:26599:12
❯ workLoopSync node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:26505:5
❯ renderRootSync node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:26473:7
❯ recoverFromConcurrentError node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:25889:20
❯ performConcurrentWorkOnRoot node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:25789:22
|
src/__test__/AddImagesCarouselDialog.test.jsx > AddImagesCarouselDialog Component > handles form submission with valid data using mocked FilePond:
frontend/src/components/shared/AddImagesCarouselDialog.jsx#L53
TypeError: Cannot destructure property 'showSnack' of 'useSnackbar(...)' as it is undefined.
❯ AddImagesCarouselDialog src/components/shared/AddImagesCarouselDialog.jsx:53:13
❯ renderWithHooks node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:15486:18
❯ mountIndeterminateComponent node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:20103:13
❯ beginWork node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:21626:16
❯ beginWork$1 node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27465:14
❯ performUnitOfWork node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:26599:12
❯ workLoopSync node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:26505:5
❯ renderRootSync node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:26473:7
❯ recoverFromConcurrentError node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:25889:20
❯ performConcurrentWorkOnRoot node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:25789:22
|
src/__test__/AddImagesCarouselDialog.test.jsx > AddImagesCarouselDialog Component > shows error when no image is added:
frontend/src/components/shared/AddImagesCarouselDialog.jsx#L53
TypeError: Cannot destructure property 'showSnack' of 'useSnackbar(...)' as it is undefined.
❯ AddImagesCarouselDialog src/components/shared/AddImagesCarouselDialog.jsx:53:13
❯ renderWithHooks node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:15486:18
❯ mountIndeterminateComponent node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:20103:13
❯ beginWork node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:21626:16
❯ beginWork$1 node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27465:14
❯ performUnitOfWork node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:26599:12
❯ workLoopSync node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:26505:5
❯ renderRootSync node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:26473:7
❯ recoverFromConcurrentError node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:25889:20
❯ performConcurrentWorkOnRoot node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:25789:22
|
src/__test__/AddImagesCarouselDialog.test.jsx > AddImagesCarouselDialog Component > toggles link input visibility:
frontend/src/components/shared/AddImagesCarouselDialog.jsx#L53
TypeError: Cannot destructure property 'showSnack' of 'useSnackbar(...)' as it is undefined.
❯ AddImagesCarouselDialog src/components/shared/AddImagesCarouselDialog.jsx:53:13
❯ renderWithHooks node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:15486:18
❯ mountIndeterminateComponent node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:20103:13
❯ beginWork node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:21626:16
❯ beginWork$1 node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:27465:14
❯ performUnitOfWork node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:26599:12
❯ workLoopSync node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:26505:5
❯ renderRootSync node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:26473:7
❯ recoverFromConcurrentError node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:25889:20
❯ performConcurrentWorkOnRoot node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js:25789:22
|
src/__test__/CoexistenceCommittee.test.jsx > CoexistenceCommittee component > renders the form correctly:
frontend/src/__test__/CoexistenceCommittee.test.jsx#L34
Error: [vitest] No "SnackbarProvider" export is defined on the "../components/context/SnackbarContext" mock. Did you forget to return it from "vi.mock"?
If you need to partially mock a module, you can use "importOriginal" helper inside:
vi.mock(import("../components/context/SnackbarContext"), async (importOriginal) => {
const actual = await importOriginal()
return {
...actual,
// your mocked methods
}
})
❯ src/__test__/CoexistenceCommittee.test.jsx:34:14
|
src/__test__/CoexistenceCommittee.test.jsx > CoexistenceCommittee component > displays validation errors when fields are empty:
frontend/src/__test__/CoexistenceCommittee.test.jsx#L53
Error: [vitest] No "SnackbarProvider" export is defined on the "../components/context/SnackbarContext" mock. Did you forget to return it from "vi.mock"?
If you need to partially mock a module, you can use "importOriginal" helper inside:
vi.mock(import("../components/context/SnackbarContext"), async (importOriginal) => {
const actual = await importOriginal()
return {
...actual,
// your mocked methods
}
})
❯ src/__test__/CoexistenceCommittee.test.jsx:53:14
|
src/__test__/CoexistenceCommittee.test.jsx > CoexistenceCommittee component > submits the form correctly when fields are filled:
frontend/src/__test__/CoexistenceCommittee.test.jsx#L74
Error: [vitest] No "SnackbarProvider" export is defined on the "../components/context/SnackbarContext" mock. Did you forget to return it from "vi.mock"?
If you need to partially mock a module, you can use "importOriginal" helper inside:
vi.mock(import("../components/context/SnackbarContext"), async (importOriginal) => {
const actual = await importOriginal()
return {
...actual,
// your mocked methods
}
})
❯ src/__test__/CoexistenceCommittee.test.jsx:74:14
|
src/__test__/CoexistenceCommittee.test.jsx > CoexistenceCommittee component > handles submission error correctly:
frontend/src/__test__/CoexistenceCommittee.test.jsx#L117
Error: [vitest] No "SnackbarProvider" export is defined on the "../components/context/SnackbarContext" mock. Did you forget to return it from "vi.mock"?
If you need to partially mock a module, you can use "importOriginal" helper inside:
vi.mock(import("../components/context/SnackbarContext"), async (importOriginal) => {
const actual = await importOriginal()
return {
...actual,
// your mocked methods
}
})
❯ src/__test__/CoexistenceCommittee.test.jsx:117:14
|
src/__test__/SwiperSlider.test.jsx > SwiperSlider Component > renders SwiperSlider with all managers:
frontend/src/__test__/SwiperSlider.test.jsx#L20
TestingLibraryElementError: Unable to find an element with the text: Rodrigo Lozano. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
Ignored nodes: comments, script, style
<body>
<div>
<div
class="swiper swiper-initialized swiper-horizontal mySwiper"
style="width: 100%; padding: 2rem; user-select: none;"
>
<div
class="swiper-wrapper"
style="transition-duration: 0ms; transition-delay: 0ms; transform: translate3d(NaNpx, 0px, 0px);"
>
<div
class="swiper-slide"
role="listitem"
>
<div
class="MuiBox-root css-112xhuj"
>
<img
alt="Marcela Osorio"
src="/src/images/managers-jr/28553156.webp"
style="width: 100%; max-width: 350px; border-radius: 5%; object-fit: cover;"
/>
<div
class="MuiBox-root css-1f22eb2"
>
<h4
class="MuiTypography-root MuiTypography-h4 css-f84ov1-MuiTypography-root"
>
Marcela Osorio
</h4>
<h6
class="MuiTypography-root MuiTypography-subtitle1 css-1i3tsf3-MuiTypography-root"
>
GERENTE JR. DE MESA DE SERVICIO
</h6>
</div>
</div>
</div>
<div
class="swiper-slide"
role="listitem"
>
<div
class="MuiBox-root css-112xhuj"
>
<img
alt="Christian Moncaleano"
src="/src/images/managers-jr/1010178143.webp"
style="width: 100%; max-width: 350px; border-radius: 5%; object-fit: cover;"
/>
<div
class="MuiBox-root css-1f22eb2"
>
<h4
class="MuiTypography-root MuiTypography-h4 css-f84ov1-MuiTypography-root"
>
Christian Moncaleano
</h4>
<h6
class="MuiTypography-root MuiTypography-subtitle1 css-1i3tsf3-MuiTypography-root"
>
GERENTE JR. DE APLICACIONES DE CONTACT CENTER
</h6>
</div>
</div>
</div>
<div
class="swiper-slide"
role="listitem"
>
<div
class="MuiBox-root css-112xhuj"
>
<img
alt="Adriana Barrera"
src="/src/images/managers-jr/52716114.webp"
style="width: 100%; max-width: 350px; border-radius: 5%; object-fit: cover;"
/>
<div
class="MuiBox-root css-1f22eb2"
>
<h4
class="MuiTypography-root MuiTypography-h4 css-f84ov1-MuiTypography-root"
>
Adriana Barrera
</h4>
<h6
class="MuiTypography-root MuiTypography-subtitle1 css-1i3tsf3-MuiTypography-root"
>
GERENTE DE CUENTAS
</h6>
</div>
</div>
</div>
<div
class="swiper-slide"
role="listitem"
>
<div
class="MuiBox-root css-112xhuj"
>
<img
alt="Katterene Castrillon"
src="/src/images/managers-jr/53069726.webp"
style="width: 100%; max-width: 350px; border-radius: 5%; object-fit: cover;"
/>
<div
class="MuiBox-root css-1f22eb2"
>
<h4
class="MuiTypography-root MuiTypography-h4 css-f84ov1-MuiTypography-root"
>
Katterene Castrillon
</h4>
<h6
class="MuiTypography-root MuiTypography-subtitle1 css-1i3tsf3-MuiTypography-root"
>
GERENTE DE CUENTAS
</h6>
</div>
</div>
</d
|
src/__test__/SwiperSlider.test.jsx > SwiperSlider Component > renders SwiperSlider with correct number of slides:
frontend/src/__test__/SwiperSlider.test.jsx#L27
AssertionError: expected 7 to be 9 // Object.is equality
- Expected
+ Received
- 9
+ 7
❯ src/__test__/SwiperSlider.test.jsx:27:31
|
deploy
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions/setup-node@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
deploy
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v2, actions/setup-node@v2. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|