test: added checks for timestamps in passkey test (#12003)

# Which Problems Are Solved

A test was failing because of timezone flakiness

# How the Problems Are Solved

The actual problem was an `updatedAt` field was not filled in because of
the `createdAt` was missing on an event. This caused a zero value to be
filled in into the `updatedAt` field. Postgres then stored this value
with seconds in it's timezone info, which go could not store.

By adding filling in the `createdAt` field, this does not occur.
This commit is contained in:
Wim Van Laer
2026-04-07 16:27:45 +02:00
committed by GitHub
parent 5abb51c263
commit 99ad1ea83d
@@ -218,6 +218,7 @@ func TestUserRelationalProjection_Reducers(t *testing.T) {
33,
"",
)
pkeyVerifiedEvt.Creation = time.Now()
// Test
eventReduced := callReduce(t, rawTx, handler, pkeyVerifiedEvt)
@@ -239,6 +240,8 @@ func TestUserRelationalProjection_Reducers(t *testing.T) {
assert.Equal(t, pkeyVerifiedEvt.AAGUID, gotPKey.AuthenticatorAttestationGUID)
assert.Equal(t, pkeyVerifiedEvt.SignCount, gotPKey.SignCount)
assert.Equal(t, pkeyVerifiedEvt.WebAuthNTokenName, gotPKey.Name)
assert.Equal(t, pkeyVerifiedEvt.Creation.Round(time.Millisecond), gotPKey.UpdatedAt.Round(time.Millisecond))
assert.Equal(t, pkey.CreatedAt.Round(time.Millisecond), gotPKey.CreatedAt.Round(time.Millisecond))
assert.NotZero(t, gotPKey.VerifiedAt)
})
}