Repository navigation
Implement skipped Yemot handler tests - #92
Merged
Merged
Conversation
Implement the three it.skip stub tests in yemot-handler.service.test.ts: 1. 'no class found' — seeds Student and Transportation without StudentKlass, verifies hangup with STUDENT.NO_CLASS message. 2. 'past deadline at 8:50' — sets time to exactly 8:50, verifies the boundary condition triggers hangup with SYSTEM.CLOSED. 3. 'before deadline at 8:49' — sets time to 8:49, verifies the deadline check passes and the call continues to student input and completes the happy path.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the three
it.skipstub tests inserver/src/yemot-handler.service.test.ts, covering previously untested branches inYemotHandlerService.Changes
All three tests use the existing
YemotScenarioBuilder/YemotScenarioRunnertesting utilities:no class found — hangup with STUDENT.NO_CLASS— SeedsStudentandTransportationbut omitsStudentKlass, then follows the happy path (valid TZ → valid transport → confirm departure). Verifies the handler hangs up withSTUDENT.NO_CLASSwhen no class association is found increateAbsenceRecord.past deadline — exactly at 8:50, hangup with CLOSED— Sets the system time to exactly 8:50 Israel time. Verifies the boundary condition inisPastReportingDeadline(hour === 8 && minute >= 50) triggers an immediate hangup withSYSTEM.CLOSED.before deadline — at 8:49, continues to student input— Sets the system time to 8:49 Israel time. Verifies the deadline check passes and the call proceeds through the full happy path to a successful report.Verification
All 9 tests pass: