Skip to content

Commit

Permalink
(fix) Additional test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen committed Jul 6, 2024
1 parent f590e9f commit 199906e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jest.mock('@openmrs/esm-framework', () => {
});

test('renders appointment details correctly', async () => {
const { getByText } = render(<AppointmentDetails appointment={appointment} />);
render(<AppointmentDetails appointment={appointment} />);
expect(screen.getByText(/Patient name/i)).toBeInTheDocument();
expect(screen.getByText(/John Wilson/i)).toBeInTheDocument();
expect(screen.getByText(/Age/i)).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import React, { useState, useMemo, useEffect } from 'react';
import classNames from 'classnames';
import debounce from 'lodash-es/debounce';
import isEmpty from 'lodash-es/isEmpty';
import { useTranslation } from 'react-i18next';
import { Layer, Search, RadioButtonGroup, RadioButton, StructuredListSkeleton, Tile } from '@carbon/react';
import {
ResponsiveWrapper,
reportError,
useDebounce,
useLayoutType,
usePagination,
useVisitTypes,
type VisitType,
} from '@openmrs/esm-framework';
InlineNotification,
Layer,
RadioButton,
RadioButtonGroup,
Search,
StructuredListSkeleton,
Tile,
} from '@carbon/react';
import { ResponsiveWrapper, useDebounce, useLayoutType, useVisitTypes, type VisitType } from '@openmrs/esm-framework';
import EmptyDataIllustration from '../empty-data-illustration.component';
import styles from './visit-type-selector.scss';
import { useRecommendedVisitTypes } from '../hooks/useRecommendedVisitTypes';
import { type PatientProgram } from '../../types';
import { InlineNotification } from '@carbon/react';

export interface VisitTypeSelectorProps {
onChange: (event) => void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import React, { useCallback, useState } from 'react';
import { InlineNotification, Search } from '@carbon/react';
import { InlineNotification, Search, SkeletonText } from '@carbon/react';
import { Add } from '@carbon/react/icons';
import { ExtensionSlot, isDesktop, launchWorkspace, showToast, useLayoutType } from '@openmrs/esm-framework';
import { useTranslation } from 'react-i18next';
import { ExtensionSlot, isDesktop, launchWorkspace, showToast, useLayoutType } from '@openmrs/esm-framework';
import type { Concept, Queue, QueueEntry } from '../types';
import { useQueueEntries } from '../hooks/useQueueEntries';
import { useColumns } from '../queue-table/cells/columns.resource';
import { QueueTableByStatusSkeleton } from '../queue-table/queue-table-by-status-skeleton.component';
import QueueTable from '../queue-table/queue-table.component';
import QueueTableMetrics from '../queue-table/queue-table-metrics.component';
import styles from '../queue-table/queue-table.scss';
import type { Concept, Queue, QueueEntry } from '../types';
import PatientQueueHeader from '../patient-queue-header/patient-queue-header.component';
import { SearchSkeleton } from '@carbon/react';
import { SkeletonText } from '@carbon/react';
import styles from '../queue-table/queue-table.scss';

interface QueueTablesForAllStatusesProps {
selectedQueue: Queue; // the selected queue
Expand Down
7 changes: 3 additions & 4 deletions packages/esm-ward-app/src/ward-view/ward-view.test.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import React from 'react';
import { screen } from '@testing-library/react';
import {
type Person,
type ConfigSchema,
getDefaultsFromConfigSchema,
useConfig,
useFeatureFlag,
} from '@openmrs/esm-framework';
import { screen } from '@testing-library/react';
import React from 'react';
import { useParams } from 'react-router-dom';
import { mockLocations } from '../../../../__mocks__/locations.mock';
import { mockAdmissionLocation } from '../../../../__mocks__/wards.mock';
import { renderWithSwr } from '../../../../tools/test-utils';
import { configSchema } from '../config-schema';
import { useAdmissionLocation } from '../hooks/useAdmissionLocation';
import WardView from './ward-view.component';
import { mockPatientAlice } from '../../../../__mocks__/patient.mock';
import { useAdmittedPatients } from '../hooks/useAdmittedPatients';
import useWardLocation from '../hooks/useWardLocation';
import WardView from './ward-view.component';

jest.replaceProperty(mockPatientAlice.person as Person, 'preferredName', {
uuid: '',
Expand Down

0 comments on commit 199906e

Please sign in to comment.