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:
parent
f15fadbb4d
commit
5d5805526a
|
@ -182,11 +182,15 @@ describe("SignalProtocolStore", function() {
|
||||||
record.save({ firstUse: false }).then(function() { done(); });
|
record.save({ firstUse: false }).then(function() { done(); });
|
||||||
});
|
});
|
||||||
describe('If nonblocking approval is required', function() {
|
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) {
|
it('sets non-blocking approval', function(done) {
|
||||||
store.saveIdentity(identifier, testKey.pubKey, true).then(function() {
|
store.saveIdentity(identifier, testKey.pubKey, true).then(function() {
|
||||||
record.fetch().then(function() {
|
record.fetch().then(function() {
|
||||||
assert.strictEqual(record.get('nonblockingApproval'), true);
|
assert.strictEqual(record.get('nonblockingApproval'), true);
|
||||||
assert.strictEqual(record.get('timestamp'), oldTimestamp);
|
assert.strictEqual(record.get('timestamp'), now);
|
||||||
assert.strictEqual(record.get('firstUse'), false);
|
assert.strictEqual(record.get('firstUse'), false);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue