fix(tests): use fixed timestamp in BWP test for determinism

Replace Date.now() with the pre-captured 'now' variable in the
'set a pill to BWP with infos' test. This prevents timing drift
between when test data timestamps are set and when the sandbox
is initialized, eliminating flaky failures in CI environments.

Refs: BWP-TIME-001, GAP-TEST-001

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Ben West
2026-03-17 13:28:12 -07:00
co-authored by Copilot
parent d987e55cb1
commit 358941bba2
+5 -1
View File
@@ -274,6 +274,9 @@ describe('boluswizardpreview', function ( ) {
});
it('set a pill to the BWP with infos', function (done) {
// BWP-TIME-001: Use fixed timestamp for deterministic IOB calculation
// Using `now` instead of `Date.now()` prevents timing drift between
// when data timestamps are set and when sandbox is initialized
var ctx = {
settings: {}
, pluginBase: {
@@ -297,7 +300,8 @@ describe('boluswizardpreview', function ( ) {
, profile: loadedProfile
};
var sbx = require('../lib/sandbox')().clientInit(ctx, Date.now(), data);
// Use `now` (same as data timestamps) instead of Date.now() for determinism
var sbx = require('../lib/sandbox')().clientInit(ctx, now, data);
iob.setProperties(sbx);
boluswizardpreview.setProperties(sbx);