Fix failing tests except for problematic spellcheck package

pull/73/head
Beaudan 7 years ago
parent d8a410cc69
commit eb7a0dbb3a

@ -161,6 +161,11 @@
return undefined;
},
async getLocalRegistrationId() {
const item = await window.Signal.Data.getItemById('registrationId');
if (item) {
return item.value;
}
return 1;
// const item = await window.Signal.Data.getItemById('registrationId');

@ -146,6 +146,8 @@ describe('Conversation', () => {
describe('Conversation search', () => {
let convo;
before(clearDatabase);
beforeEach(async () => {
convo = new Whisper.ConversationCollection().add({
id: '771d11d01e56d9bfc3d74115c33225a632321b509ac17a13fdeac71165d09b94ab',

@ -19,9 +19,10 @@ describe('SignalProtocolStore', () => {
privKey: libsignal.crypto.getRandomBytes(32),
};
storage.put('registrationId', 1337);
storage.put('identityKey', identityKey);
storage.fetch().then(done, done);
storage.put('registrationId', 1337)
.then(() => storage.put('identityKey', identityKey))
.then(() => storage.fetch())
.then(done, done);
});
describe('getLocalRegistrationId', () => {

@ -1,11 +1,17 @@
/* global ConversationController, textsecure, Whisper */
/* global storage, libsignal, ConversationController, textsecure, Whisper */
describe('InboxView', () => {
let inboxView;
let conversation;
let identityKey;
before(async () => {
ConversationController.reset();
identityKey = {
pubKey: libsignal.crypto.getRandomBytes(33),
privKey: libsignal.crypto.getRandomBytes(32),
};
storage.put('identityKey', identityKey);
await ConversationController.load();
await ConversationController.getOrCreateAndWait(
textsecure.storage.user.getNumber(),

@ -1,4 +1,5 @@
import { assert } from 'chai';
import moment from 'moment';
import * as Attachment from '../../types/Attachment';
import * as MIME from '../../types/MIME';
@ -44,7 +45,7 @@ describe('Attachment', () => {
data: stringToArrayBuffer('foo'),
contentType: MIME.VIDEO_QUICKTIME,
};
const timestamp = new Date(new Date(0).getTimezoneOffset() * 60 * 1000);
const timestamp = new Date(-moment().utcOffset() * 60 * 1000);
const actual = Attachment.getSuggestedFilename({
attachment,
timestamp,

Loading…
Cancel
Save