-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
470 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/esm-patient-registration-app/src/add-patient-link.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import { render, fireEvent } from '@testing-library/react'; | ||
import * as esmFramework from '@openmrs/esm-framework'; | ||
import Root from './add-patient-link'; | ||
|
||
describe('Add patient link component', () => { | ||
it('renders an "Add Patient" button and triggers navigation on click', () => { | ||
const navigateMock = jest.fn(); | ||
jest.spyOn(esmFramework, 'navigate').mockImplementation(navigateMock); | ||
|
||
const { getByRole } = render(<Root />); | ||
const addButton = getByRole('button', { name: /add patient/i }); | ||
|
||
fireEvent.click(addButton); | ||
|
||
expect(navigateMock).toHaveBeenCalledWith({ to: '${openmrsSpaBase}/patient-registration' }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/esm-patient-registration-app/src/nav-link.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import Root from './nav-link'; | ||
|
||
describe('Nav link component', () => { | ||
it('renders a link to the patient registration page', () => { | ||
const { getByText } = render(<Root />); | ||
const linkElement = getByText('Patient Registration'); | ||
|
||
expect(linkElement).toBeInTheDocument(); | ||
expect(linkElement).toHaveAttribute('href', '/openmrs/spa/patient-registration'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,3 +111,8 @@ | |
.comboInputEntries { | ||
position: relative; | ||
} | ||
|
||
.comboInputItemOption { | ||
margin: 0; | ||
padding-left: 1rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.