test(drip): freeze time to deflake the AI consent onboarding-grace boundary
The two now() calls in userWithConsent() are evaluated microseconds apart, so accepted_at lands just after created_at + grace, tipping the exactly-3-days boundary case over and dispatching a job the test asserts against. Freezing time makes the day-relative timestamps land on exact boundaries.
This commit is contained in:
parent
3d3f6daa77
commit
674fe7db08
|
|
@ -9,6 +9,10 @@ use App\Models\UserMailLog;
|
|||
use Illuminate\Support\Facades\Bus;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
// Freeze time so day-relative timestamps land on exact boundaries; without this the
|
||||
// two now() calls below drift by microseconds and tip the "exactly 3 days" case over.
|
||||
beforeEach(fn () => $this->freezeTime());
|
||||
|
||||
/**
|
||||
* Creates a user whose AI consent was recorded $acceptedDaysAgo days ago, having
|
||||
* signed up $signedUpDaysAgo days ago.
|
||||
|
|
|
|||
Loading…
Reference in New Issue