Fix a test

Set the timestamp on the record to current time to ensure that
nonblockingApproval will be required.

// FREEBIE
This commit is contained in:
lilia 2017-06-17 15:41:42 -07:00 committed by Scott Nonnenberg
parent f15fadbb4d
commit 5d5805526a
1 changed files with 5 additions and 1 deletions

View File

@ -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();
});