Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRMDR 656 - LG Record Uploading View #292

Merged
merged 18 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import {
DOCUMENT_TYPE,
DOCUMENT_UPLOAD_STATE as documentUploadStates,
UploadDocument,
} from '../../../types/pages/UploadDocumentsPage/types';
import { buildPatientDetails, buildTextFile } from '../../../helpers/test/testBuilders';
} from '../../../../types/pages/UploadDocumentsPage/types';
import { buildPatientDetails, buildTextFile } from '../../../../helpers/test/testBuilders';
import CompleteStage from './CompleteStage';
import { useNavigate } from 'react-router';
import usePatient from '../../../helpers/hooks/usePatient';
import usePatient from '../../../../helpers/hooks/usePatient';

jest.mock('react-router');
jest.mock('../../../helpers/hooks/usePatient');
jest.mock('../../../../helpers/hooks/usePatient');

const mockedUsePatient = usePatient as jest.Mock;
const mockPatientDetails = buildPatientDetails();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Button } from 'nhsuk-react-components';
import { useNavigate } from 'react-router';
import { UploadDocument } from '../../../types/pages/UploadDocumentsPage/types';
import { UploadDocument } from '../../../../types/pages/UploadDocumentsPage/types';
import UploadSummary from '../uploadSummary/UploadSummary';
interface Props {
documents: Array<UploadDocument>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
DOCUMENT_TYPE,
FileInputEvent,
UploadDocument,
} from '../../../types/pages/UploadDocumentsPage/types';
import formatFileSize from '../../../helpers/utils/formatFileSize';
} from '../../../../types/pages/UploadDocumentsPage/types';
import formatFileSize from '../../../../helpers/utils/formatFileSize';
import { FieldValues, UseControllerReturn } from 'react-hook-form';

type Props = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { buildSearchResult } from '../../../helpers/test/testBuilders';
import { getFormattedDatetime } from '../../../helpers/utils/formatDatetime';
import { SearchResult } from '../../../types/generic/searchResult';
import { buildSearchResult } from '../../../../helpers/test/testBuilders';
import { getFormattedDatetime } from '../../../../helpers/utils/formatDatetime';
import { SearchResult } from '../../../../types/generic/searchResult';
import DocumentSearchResults from './DocumentSearchResults';
import { render, screen, within } from '@testing-library/react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Table } from 'nhsuk-react-components';
import { SearchResult } from '../../../types/generic/searchResult';
import { SearchResult } from '../../../../types/generic/searchResult';
import { useState } from 'react';
import { getFormattedDatetime } from '../../../helpers/utils/formatDatetime';
import { getFormattedDatetime } from '../../../../helpers/utils/formatDatetime';

type Props = {
searchResults: Array<SearchResult>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import axios from 'axios';
import DocumentSearchResultsOptions from './DocumentSearchResultsOptions';
import { SUBMISSION_STATE } from '../../../types/pages/documentSearchResultsPage/types';
import { routes } from '../../../types/generic/routes';
import { buildPatientDetails } from '../../../helpers/test/testBuilders';
import { SUBMISSION_STATE } from '../../../../types/pages/documentSearchResultsPage/types';
import { routes } from '../../../../types/generic/routes';
import { buildPatientDetails } from '../../../../helpers/test/testBuilders';

const mockedUseNavigate = jest.fn();
jest.mock('../../../helpers/hooks/useBaseAPIHeaders');
jest.mock('../../../helpers/hooks/useBaseAPIUrl');
jest.mock('../../../../helpers/hooks/useBaseAPIHeaders');
jest.mock('../../../../helpers/hooks/useBaseAPIUrl');
jest.mock('axios');
jest.mock('react-router', () => ({
useNavigate: () => mockedUseNavigate,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Button, ButtonLink } from 'nhsuk-react-components';
import SpinnerButton from '../../generic/spinnerButton/SpinnerButton';
import { routes } from '../../../types/generic/routes';
import { SUBMISSION_STATE } from '../../../types/pages/documentSearchResultsPage/types';
import SpinnerButton from '../../../generic/spinnerButton/SpinnerButton';
import { routes } from '../../../../types/generic/routes';
import { SUBMISSION_STATE } from '../../../../types/pages/documentSearchResultsPage/types';
import { useNavigate } from 'react-router-dom';
import getPresignedUrlForZip from '../../../helpers/requests/getPresignedUrlForZip';
import getPresignedUrlForZip from '../../../../helpers/requests/getPresignedUrlForZip';
import { AxiosError } from 'axios';
import { Dispatch, SetStateAction, useEffect, useRef, useState } from 'react';
import useBaseAPIHeaders from '../../../helpers/hooks/useBaseAPIHeaders';
import { DOCUMENT_TYPE } from '../../../types/pages/UploadDocumentsPage/types';
import useBaseAPIUrl from '../../../helpers/hooks/useBaseAPIUrl';
import { errorToParams } from '../../../helpers/utils/errorToParams';
import useBaseAPIHeaders from '../../../../helpers/hooks/useBaseAPIHeaders';
import { DOCUMENT_TYPE } from '../../../../types/pages/UploadDocumentsPage/types';
import useBaseAPIUrl from '../../../../helpers/hooks/useBaseAPIUrl';
import { errorToParams } from '../../../../helpers/utils/errorToParams';

type Props = {
nhsNumber: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import {
buildPatientDetails,
buildTextFile,
buildLgFile,
} from '../../../helpers/test/testBuilders';
} from '../../../../helpers/test/testBuilders';
import userEvent from '@testing-library/user-event';
import { DOCUMENT_UPLOAD_STATE as documentUploadStates } from '../../../types/pages/UploadDocumentsPage/types';
import { DOCUMENT_UPLOAD_STATE as documentUploadStates } from '../../../../types/pages/UploadDocumentsPage/types';
import { act } from 'react-dom/test-utils';
import { PatientDetails } from '../../../types/generic/patientDetails';
import usePatient from '../../../helpers/hooks/usePatient';
import { PatientDetails } from '../../../../types/generic/patientDetails';
import usePatient from '../../../../helpers/hooks/usePatient';

jest.mock('../../../helpers/utils/toFileList', () => ({
jest.mock('../../../../helpers/utils/toFileList', () => ({
__esModule: true,
default: () => [],
}));
jest.mock('../../../helpers/hooks/usePatient');
jest.mock('react-router');
jest.mock('../../../../helpers/hooks/usePatient');
const mockedUsePatient = usePatient as jest.Mock;
const mockPatient = buildPatientDetails();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import {
FileInputEvent,
SetUploadDocuments,
UploadDocument,
} from '../../../types/pages/UploadDocumentsPage/types';
} from '../../../../types/pages/UploadDocumentsPage/types';
import { Button, Fieldset } from 'nhsuk-react-components';
import { useController, useForm } from 'react-hook-form';
import toFileList from '../../../helpers/utils/toFileList';
import PatientSummary from '../../generic/patientSummary/PatientSummary';
import toFileList from '../../../../helpers/utils/toFileList';
import PatientSummary from '../../../generic/patientSummary/PatientSummary';
import DocumentInputForm from '../documentInputForm/DocumentInputForm';
import { ARFFormConfig, lloydGeorgeFormConfig } from '../../../helpers/utils/formConfig';
import { ARFFormConfig, lloydGeorgeFormConfig } from '../../../../helpers/utils/formConfig';

interface Props {
uploadDocuments: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import UploadSummary, { Props } from './UploadSummary';
import {
DOCUMENT_UPLOAD_STATE as documentUploadStates,
UploadDocument,
} from '../../../types/pages/UploadDocumentsPage/types';
import { formatFileSize as formatSize } from '../../../helpers/utils/formatFileSize';
import { getFormattedDate } from '../../../helpers/utils/formatDate';
} from '../../../../types/pages/UploadDocumentsPage/types';
import { formatFileSize as formatSize } from '../../../../helpers/utils/formatFileSize';
import { getFormattedDate } from '../../../../helpers/utils/formatDate';
import {
buildDocument,
buildPatientDetails,
buildTextFile,
} from '../../../helpers/test/testBuilders';
import usePatient from '../../../helpers/hooks/usePatient';
} from '../../../../helpers/test/testBuilders';
import usePatient from '../../../../helpers/hooks/usePatient';

jest.mock('../../../helpers/hooks/usePatient');
jest.mock('../../../../helpers/hooks/usePatient');
const mockedUsePatient = usePatient as jest.Mock;
const mockPatient = buildPatientDetails();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import React from 'react';
import {
DOCUMENT_UPLOAD_STATE,
UploadDocument,
} from '../../../types/pages/UploadDocumentsPage/types';
import formatFileSize from '../../../helpers/utils/formatFileSize';
import { getFormattedDate } from '../../../helpers/utils/formatDate';
import ErrorBox from '../../layout/errorBox/ErrorBox';
import PatientSummary from '../../generic/patientSummary/PatientSummary';
} from '../../../../types/pages/UploadDocumentsPage/types';
import formatFileSize from '../../../../helpers/utils/formatFileSize';
import { getFormattedDate } from '../../../../helpers/utils/formatDate';
import ErrorBox from '../../../layout/errorBox/ErrorBox';
import PatientSummary from '../../../generic/patientSummary/PatientSummary';

export interface Props {
documents: Array<UploadDocument>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
DOCUMENT_UPLOAD_STATE,
DOCUMENT_UPLOAD_STATE as documentUploadStates,
UploadDocument,
} from '../../../types/pages/UploadDocumentsPage/types';
import { buildTextFile } from '../../../helpers/test/testBuilders';
} from '../../../../types/pages/UploadDocumentsPage/types';
import { buildTextFile } from '../../../../helpers/test/testBuilders';
import UploadingStage from './UploadingStage';

describe('<UploadDocumentsPage />', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from 'react';
import {
UploadDocument,
DOCUMENT_UPLOAD_STATE,
} from '../../../types/pages/UploadDocumentsPage/types';
} from '../../../../types/pages/UploadDocumentsPage/types';
import { Table, WarningCallout } from 'nhsuk-react-components';
import formatFileSize from '../../../helpers/utils/formatFileSize';
import formatFileSize from '../../../../helpers/utils/formatFileSize';

interface Props {
documents: Array<UploadDocument>;
Expand Down
Loading
Loading