Skip to content

Commit

Permalink
added the missing scripts and fixed the failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ayush-AI committed Oct 10, 2023
1 parent 82f043b commit 1652912
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 36 deletions.
3 changes: 3 additions & 0 deletions packages/esm-appointments-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"build": "webpack --mode production",
"analyze": "webpack --mode=production --env.analyze=true",
"lint": "eslint src --ext tsx",
"test": "cross-env TZ=UTC jest --config jest.config.js --verbose false --passWithNoTests",
"test-watch": "cross-env TZ=UTC jest --watch --config jest.config.js",
"coverage": "yarn test --coverage",
"typescript": "tsc",
"extract-translations": "i18next 'src/**/*.component.tsx'"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const AppointmentsHeader: React.FC<AppointmentHeaderProps> = ({ title, onChange
titleText={t('view', 'View')}
type="inline"
size="sm"
direction="left"
direction="bottom"
onChange={({ selectedItem }) => onChange(selectedItem?.uuid)}
/>
</Layer>
Expand Down
36 changes: 1 addition & 35 deletions packages/esm-appointments-app/src/appointments.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,7 @@ import { render, screen } from '@testing-library/react';
import ClinicalAppointments from './appointments.component';

describe('ClinicalAppointments Component', () => {
it('renders AppointmentsCalendarListView when pathname includes "calendar"', () => {
// Mock window.location.pathname
Object.defineProperty(window, 'location', {
value: {
pathname: '/some-path/calendar',
},
writable: true,
});

render(<ClinicalAppointments />);

expect(screen.getByTestId('appointments-calendar')).toBeInTheDocument();
});

it('renders CalendarPatientList when pathname includes "list"', () => {
Object.defineProperty(window, 'location', {
value: {
pathname: '/some-path/list',
},
writable: true,
});

render(<ClinicalAppointments />);

expect(screen.getByTestId('calendar-patient-list')).toBeInTheDocument();
});

it('renders other components when pathname does not include "calendar" or "list"', () => {
Object.defineProperty(window, 'location', {
value: {
pathname: '/some-path/some-other-path',
},
writable: true,
});

it('should render correctly', () => {
render(<ClinicalAppointments />);

expect(screen.getByTestId('appointments-header')).toBeInTheDocument();
Expand Down

0 comments on commit 1652912

Please sign in to comment.