Closed Timothy-Gonzalez closed 1 month ago
Decided against having an env variable that would never be used anyways (humans are lazy).
Instead, we now have three tests:
GetUserQR
which verifies a token does, and will, expire in a reasonable time.TestStaffCheckinBadUserTokenExpiredToken
which verifies a expired token cannot be used to check in (and there is also a test for invalid params, malformed token, so every other fail case should be covered)TestStaffCheckinFromGetUserQR
which verifies that the full workflow works, by fetching a qr and then using it to checkinTogether, this validates that a generated token will expire (1), an invalid token will not work to checkin (2), and that a valid token is generated normally and will work to checkin (3).
This may be more complicated than waiting 20 seconds, but we'd never want to wait that long anyways, and a test that never gets run is as good as a test that doesn't exist.
Anyways, should be good now.
This test encompasses both
GET /user/qr/
andPOST /event/staff/checkin/
, to verify that they always work together.