-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Detect Cancel Pending Reservation Event in extension_log #875
Conversation
Co-authored-by: Rogelio Macedo <32654086+rmace001@users.noreply.github.com> Co-authored-by: Alexander Yee <32520269+YeeitsAlex@users.noreply.github.com>
Cannot test “cancel pending reservation” because of limitations in the test with running asynchronous extension services. Instead, we have successfully tested an “event created” log, which is a synchronous extension. The next step is to run asynchronous extensions as synchronous during testing. This pull request is ready for review. |
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.
There is a small error in the extension script (we forgot to cover one case) which is preventing the tests to pass.
Once this small issue is fixed we can merge the pull request
Great Job! Thanks for your contribution!
invoiceNumber: 'blabla' | ||
}; | ||
} | ||
} |
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.
The test is currently failing because we forgot to add here a "return null;" statement to cover all the other Sync events (like RESERVATION_VALIDATION) that expect the script to return something. So this should be:
function executeScript(scriptEvent) {
log.warn('hello from script with event: ' + scriptEvent);
extensionLogger.logInfo(scriptEvent);//logs into the extension_log table
if(scriptEvent === 'INVOICE_GENERATION') {
return {
invoiceNumber: 'blabla'
};
}
return null;
}
instead
Co-authored-by: Mark Alexander Bis <35311810+MarkBis415@users.noreply.github.com> Co-authored-by: Alexander Yee <32520269+YeeitsAlex@users.noreply.github.com>
merged. Thanks! 👍 |
Modify ReservationFlowIntegrationTest to assert that the
RESERVATION_CANCELLED
event is fired when callingreservationApiV2Controller.cancelPendingReservation
.This requires the following to occur:
Extension.js
tosrc/test/resources/
RESERVATION_CANCELLED
TODO: 4. Clear the extension log table
TRUNCATE TABLE table_name;
extension_log
Current behavior
Presence of
RESERVATION_CANCELLED
log has been asserted. Also, there are always eight rows in the log when we insert two extensions (one async and one sync). The test still fails due to the following:On track to close #873.
Contributors: @MarkBis415, @rmace001, @YeeitsAlex