Fix tests

// FREEBIE
This commit is contained in:
lilia 2017-05-26 17:39:20 -07:00 committed by Scott Nonnenberg
parent f095a1583e
commit 2584f4fae4
4 changed files with 15 additions and 6 deletions

View file

@ -56,7 +56,7 @@ describe("SignalProtocolStore", function() {
describe('isTrustedIdentity', function() {
it('returns true if a key is trusted', function(done) {
store.saveIdentity(identifier, testKey.pubKey).then(function() {
store.isTrustedIdentity(identifier, testKey.pubKey).then(function(trusted) {
store.isTrustedIdentity(identifier, testKey.pubKey, store.Direction.RECEIVING).then(function(trusted) {
if (trusted) {
done();
} else {
@ -68,7 +68,7 @@ describe("SignalProtocolStore", function() {
it('returns false if a key is untrusted', function(done) {
var newIdentity = libsignal.crypto.getRandomBytes(33);
store.saveIdentity(identifier, testKey.pubKey).then(function() {
store.isTrustedIdentity(identifier, newIdentity).then(function(trusted) {
store.isTrustedIdentity(identifier, newIdentity, store.Direction.SENDING).then(function(trusted) {
if (trusted) {
done(new Error('Allowed to overwrite identity key'));
} else {