{
+ async () => {
if (isViewPrintDetailsEnabled) {
const selectedPickSlips = getSelectedSlipDataMulti(pickSlipsData, selectedRows);
const selectedRequestIds = extractPickSlipRequestIds(selectedPickSlips);
- this.savePrintEventDetails(selectedRequestIds);
+ await this.savePrintEventDetails(selectedRequestIds);
}
}
}
+ onAfterPrint={this.onAfterPrintForPrintButton}
>
diff --git a/src/routes/RequestsRoute.test.js b/src/routes/RequestsRoute.test.js
index d855d174..a6a4d2cf 100644
--- a/src/routes/RequestsRoute.test.js
+++ b/src/routes/RequestsRoute.test.js
@@ -123,8 +123,6 @@ jest.mock('./utils', () => ({
...jest.requireActual('./utils'),
getFormattedYears: jest.fn(),
getStatusQuery: jest.fn(),
- filterRecordsByPrintStatus: jest.fn(),
- getPrintStatusFilteredData: jest.fn(),
}));
jest.mock('../components', () => ({
ErrorModal: jest.fn(({ onClose }) => (
@@ -141,11 +139,13 @@ jest.mock('../components', () => ({
PrintButton: jest.fn(({
onBeforeGetContent,
onBeforePrint,
+ onAfterPrint,
children,
}) => {
const handleClick = () => {
- onBeforeGetContent();
- onBeforePrint();
+ Promise.resolve(onBeforeGetContent());
+ Promise.resolve(onBeforePrint());
+ Promise.resolve(onAfterPrint());
};
return (
@@ -178,10 +178,12 @@ jest.mock('../RequestForm', () => jest.fn());
jest.mock('../components/SinglePrintButtonForPickSlip', () => jest.fn(({
onBeforeGetContentForSinglePrintButton,
onBeforePrintForSinglePrintButton,
+ onAfterPrintForSinglePrintButton,
}) => {
const handleClick = () => {
onBeforeGetContentForSinglePrintButton();
onBeforePrintForSinglePrintButton(['reqId']);
+ onAfterPrintForSinglePrintButton();
};
return (