Fix tests

pull/203/head
Beaudan 6 years ago
parent dc67aaf9cc
commit 0516e69ff7

@ -34,6 +34,10 @@ class LokiP2pAPI extends EventEmitter {
pingTimer: null,
isOnline: false,
};
if (isPing) {
this.setContactOnline(pubKey);
return;
}
// Try ping
this.pingContact(pubKey);
return;

@ -1,7 +1,7 @@
const { assert } = require('chai');
const LokiP2pAPI = require('../../../js/modules/loki_p2p_api');
describe('LocalLokiServer', () => {
describe('LokiP2pAPI', () => {
const usedKey = 'aPubKey';
const usedAddress = 'anAddress';
const usedPort = 'aPort';
@ -64,16 +64,16 @@ describe('LocalLokiServer', () => {
usedKey,
usedAddress,
usedPort,
true
false
);
assert.isTrue(this.lokiP2pAPI.isOnline(usedKey));
assert.isFalse(this.lokiP2pAPI.isOnline(usedKey));
this.lokiP2pAPI.updateContactP2pDetails(
usedKey,
usedAddress,
usedPort,
false
true
);
assert.isFalse(this.lokiP2pAPI.isOnline(usedKey));
assert.isTrue(this.lokiP2pAPI.isOnline(usedKey));
});
it('Should set a contact as offline', () => {

Loading…
Cancel
Save