-
Notifications
You must be signed in to change notification settings - Fork 245
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
(feat) O3-4040: Add delete ability to program enrollments #2133
base: main
Are you sure you want to change the base?
(feat) O3-4040: Add delete ability to program enrollments #2133
Conversation
…dit" and "delete" options for individual programs
…t button and the new delete button
…ved(clicking on the overflow menu) to get to the "edit" button
@vasharma05 @denniskigen can you please review this for me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, @PiusKariuki ! The main thing is to clean up the user-facing text. We don't want to scare users by making them think they might be deleting a whole program, when they are in fact just deleting the patient's enrollment.
packages/esm-patient-programs-app/src/programs/program-actions-menu.scss
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program.modal.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program.modal.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program.modal.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program.modal.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-programs-app/src/programs/delete-program.modal.tsx
Outdated
Show resolved
Hide resolved
…http request function
…http request function
…e enrollments resource before closing the modal
… cancel button is clicked" test
@brandones @denniskigen . I resolved the failing E2E and suggestions too. Please review and revert incase of any more feedback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @PiusKariuki! A few minor nitpicks
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please note this.
jest.mock('@openmrs/esm-framework', () => ({ | ||
showSnackbar: jest.fn(), | ||
getCoreTranslation: jest.fn((key, defaultText) => defaultText), | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And please update the mocks
…to feat/delete-programs-feature
expect(mockDeleteProgramEnrollment).toHaveBeenCalledTimes(1); | ||
expect(mockDeleteProgramEnrollment).toHaveBeenCalledTimes(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(mockDeleteProgramEnrollment).toHaveBeenCalledTimes(1); | |
expect(mockDeleteProgramEnrollment).toHaveBeenCalledTimes(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best to call this file programs-actions-menu.test.tsx
. The component
extension isn't required for tests.
mockUseLayoutType.mockReturnValue('small-desktop'); // or 'large-desktop' or 'tablet' | ||
}); | ||
|
||
it('renders OverflowMenu with edit and delete actions', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('renders OverflowMenu with edit and delete actions', async () => { | |
it('renders an overflow menu with edit and delete actions', async () => { |
const overFlowButton = screen.getByRole('button'); | ||
await user.click(overFlowButton); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const overFlowButton = screen.getByRole('button'); | |
await user.click(overFlowButton); | |
const overflowMenuButton = screen.getByRole('button', { name: /options/i }); | |
await user.click(overflowMenuButton); |
Requirements
Summary
This PR adds DELETE ability to program enrollments
Screenshots
Related Issue
https://openmrs.atlassian.net/browse/O3-4040
Other