connect: the expiry test can only pass on the marker's own expiry
At ten minutes on, the local session was stale too, so the test stayed green with the marker's expiry check deleted. The session is now fresh at the later time; deleting the check turns it red.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+4
−1
connect/linked_test.go+4 −1
CI passed — run details
diff --git a/connect/linked_test.go b/connect/linked_test.go| index b545941..30c3b25 100644 |
| --- a/connect/linked_test.go |
| +++ b/connect/linked_test.go |
| @@ -169,8 +169,10 @@ func TestUnknownMarkerExpiresToTheMenuPath(t *testing.T) { |
| f := newBridgeFixture(t) |
| h := f.routes(t) |
| marker := f.unknownArrival(t, "opaque-one") |
| - local := f.local(t, "one@example.com", "magiclink", time.Time{}) |
| later := time.Now().Add(time.Duration(localLinkNavigationLifetime+1) * time.Second) |
| + // The local sign-in is fresh at the later time too, so only the |
| + // marker's own expiry can decide. |
| + local := f.local(t, "one@example.com", "magiclink", later.Add(-time.Minute)) |
| h.navigation.now = func() time.Time { return later } |
| w := httptest.NewRecorder() |
| h.LocalComplete(w, bridgeRequest(http.MethodGet, LocalCompletePath, []*http.Cookie{marker, local})) |
| @@ -183,6 +185,7 @@ func TestUnknownMarkerExpiresToTheMenuPath(t *testing.T) { |
| } |
| } |
| h.navigation.now = time.Now |
| + local = f.local(t, "one@example.com", "magiclink", time.Time{}) |
| stale := f.local(t, "one@example.com", "keymail", time.Now().Add(-10*time.Minute)) |
| w = httptest.NewRecorder() |
| h.LocalComplete(w, bridgeRequest(http.MethodGet, LocalCompletePath, []*http.Cookie{f.unknownArrival(t, "opaque-one"), stale})) |