From 5d5805526a6220199885d350428a524f12d5ee40 Mon Sep 17 00:00:00 2001 From: lilia Date: Sat, 17 Jun 2017 15:41:42 -0700 Subject: [PATCH] Fix a test Set the timestamp on the record to current time to ensure that nonblockingApproval will be required. // FREEBIE --- test/storage_test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/storage_test.js b/test/storage_test.js index 52d630dba..147aa36a5 100644 --- a/test/storage_test.js +++ b/test/storage_test.js @@ -182,11 +182,15 @@ describe("SignalProtocolStore", function() { record.save({ firstUse: false }).then(function() { done(); }); }); describe('If nonblocking approval is required', function() { + var now = Date.now(); + before(function(done) { + record.save({ timestamp: now }).then(function() { done(); }); + }); it('sets non-blocking approval', function(done) { store.saveIdentity(identifier, testKey.pubKey, true).then(function() { record.fetch().then(function() { assert.strictEqual(record.get('nonblockingApproval'), true); - assert.strictEqual(record.get('timestamp'), oldTimestamp); + assert.strictEqual(record.get('timestamp'), now); assert.strictEqual(record.get('firstUse'), false); done(); });