Linting of the test flies

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

@ -366,12 +366,12 @@ describe('Backup', () => {
(message.contact || []).map(async contact => { (message.contact || []).map(async contact => {
return contact && contact.avatar && contact.avatar.avatar return contact && contact.avatar && contact.avatar.avatar
? Object.assign({}, contact, { ? Object.assign({}, contact, {
avatar: Object.assign({}, contact.avatar, { avatar: Object.assign({}, contact.avatar, {
avatar: await wrappedLoadAttachment( avatar: await wrappedLoadAttachment(
contact.avatar.avatar contact.avatar.avatar
), ),
}), }),
}) })
: contact; : contact;
}) })
), ),

@ -352,6 +352,7 @@
<script type="text/javascript" src="../js/libtextsecure.js" data-cover></script> <script type="text/javascript" src="../js/libtextsecure.js" data-cover></script>
<script type="text/javascript" src="../js/libphonenumber-util.js"></script> <script type="text/javascript" src="../js/libphonenumber-util.js"></script>
<script type='text/javascript' src='../js/models/profile.js' data-cover></script>
<script type="text/javascript" src="../js/models/messages.js" data-cover></script> <script type="text/javascript" src="../js/models/messages.js" data-cover></script>
<script type="text/javascript" src="../js/models/conversations.js" data-cover></script> <script type="text/javascript" src="../js/models/conversations.js" data-cover></script>
<script type="text/javascript" src="../js/models/blockedNumbers.js" data-cover></script> <script type="text/javascript" src="../js/models/blockedNumbers.js" data-cover></script>

@ -1,4 +1,4 @@
/* global storage, textsecure, Whisper */ /* global textsecure, Whisper */
'use strict'; 'use strict';
@ -72,8 +72,8 @@ describe('Conversation', () => {
assert.strictEqual(convo.contactCollection.at('2').get('name'), 'C'); assert.strictEqual(convo.contactCollection.at('2').get('name'), 'C');
}); });
it('contains its own messages', async function() { it('contains its own messages', async () => {
var convo = new Whisper.ConversationCollection().add({ const convo = new Whisper.ConversationCollection().add({
id: '771d11d01e56d9bfc3d74115c33225a632321b509ac17a13fdeac71165d09b94ab', id: '771d11d01e56d9bfc3d74115c33225a632321b509ac17a13fdeac71165d09b94ab',
}); });
await convo.fetchMessages(); await convo.fetchMessages();
@ -125,15 +125,15 @@ describe('Conversation', () => {
assert.property(avatar, 'color'); assert.property(avatar, 'color');
}); });
describe('when set to private', function() { describe('when set to private', () => {
it('correctly validates hex numbers', function() { it('correctly validates hex numbers', () => {
const regularId = new Whisper.Conversation({ type: 'private', id: '771d11d01e56d9bfc3d74115c33225a632321b509ac17a13fdeac71165d09b94ab' }); const regularId = new Whisper.Conversation({ type: 'private', id: '771d11d01e56d9bfc3d74115c33225a632321b509ac17a13fdeac71165d09b94ab' });
const invalidId = new Whisper.Conversation({ type: 'private', id: 'j71d11d01e56d9bfc3d74115c33225a632321b509ac17a13fdeac71165d09b94ab' }); const invalidId = new Whisper.Conversation({ type: 'private', id: 'j71d11d01e56d9bfc3d74115c33225a632321b509ac17a13fdeac71165d09b94ab' });
assert.ok(regularId.isValid()); assert.ok(regularId.isValid());
assert.notOk(invalidId.isValid()); assert.notOk(invalidId.isValid());
}); });
it('correctly validates length', function() { it('correctly validates length', () => {
const regularId = new Whisper.Conversation({ type: 'private', id: '771d11d01e56d9bfc3d74115c33225a632321b509ac17a13fdeac71165d09b94ab' }); const regularId = new Whisper.Conversation({ type: 'private', id: '771d11d01e56d9bfc3d74115c33225a632321b509ac17a13fdeac71165d09b94ab' });
const shortId = new Whisper.Conversation({ type: 'private', id: '771d11d' }); const shortId = new Whisper.Conversation({ type: 'private', id: '771d11d' });
const longId = new Whisper.Conversation({ type: 'private', id: '771d11d01e56d9bfc3d74115c33225a632321b509ac17a13fdeac71165d09b94abaa' }); const longId = new Whisper.Conversation({ type: 'private', id: '771d11d01e56d9bfc3d74115c33225a632321b509ac17a13fdeac71165d09b94abaa' });
@ -169,14 +169,14 @@ describe('Conversation', () => {
}) })
); );
} }
it('matches by partial keys', function() { it('matches by partial keys', () => {
return testSearch([ return testSearch([
'1', '1',
'771', '771',
'1e', '1e',
'56d9bfc3d74115c3322', '56d9bfc3d74115c3322',
'6d9bfc3d74115c33225a632321b509ac17a13fdeac71165d', '6d9bfc3d74115c33225a632321b509ac17a13fdeac71165d',
'771d11d01e56d9bfc3d74115c33225a632321b509ac17a13fdeac71165d09b94ab' '771d11d01e56d9bfc3d74115c33225a632321b509ac17a13fdeac71165d09b94ab',
]); ]);
}); });
// TODO: Re-enable once we have nickanme functionality // TODO: Re-enable once we have nickanme functionality

@ -52,7 +52,7 @@ describe('Startup', () => {
it('should be skipped if this is the primary device', async () => { it('should be skipped if this is the primary device', async () => {
const ourNumber = '+15551234567'; const ourNumber = '+15551234567';
const deviceId = '1'; const deviceId = '1';
const sendRequestConfigurationSyncMessage = () => {}; const sendRequestConfigurationSyncMessage = () => { };
const storage = {}; const storage = {};
const prepareForSend = () => ({ const prepareForSend = () => ({
wrap: promise => promise, wrap: promise => promise,
@ -78,7 +78,7 @@ describe('Startup', () => {
it('should be skipped if user has previously synced', async () => { it('should be skipped if user has previously synced', async () => {
const ourNumber = '+15551234567'; const ourNumber = '+15551234567';
const deviceId = '2'; const deviceId = '2';
const sendRequestConfigurationSyncMessage = () => {}; const sendRequestConfigurationSyncMessage = () => { };
const storage = { const storage = {
get(name) { get(name) {
if (name !== 'read-receipt-configuration-sync') { if (name !== 'read-receipt-configuration-sync') {

@ -23,7 +23,7 @@ describe('Message', () => {
body: 'Imagine there is no heaven…', body: 'Imagine there is no heaven…',
schemaVersion: 2, schemaVersion: 2,
}; };
const writeExistingAttachmentData = () => {}; const writeExistingAttachmentData = () => { };
const actual = await Message.createAttachmentDataWriter({ const actual = await Message.createAttachmentDataWriter({
writeExistingAttachmentData, writeExistingAttachmentData,
@ -43,7 +43,7 @@ describe('Message', () => {
schemaVersion: 4, schemaVersion: 4,
attachments: [], attachments: [],
}; };
const writeExistingAttachmentData = () => {}; const writeExistingAttachmentData = () => { };
const actual = await Message.createAttachmentDataWriter({ const actual = await Message.createAttachmentDataWriter({
writeExistingAttachmentData, writeExistingAttachmentData,
@ -432,7 +432,7 @@ describe('Message', () => {
describe('_withSchemaVersion', () => { describe('_withSchemaVersion', () => {
it('should require a version number', () => { it('should require a version number', () => {
const toVersionX = () => {}; const toVersionX = () => { };
assert.throws( assert.throws(
() => () =>
Message._withSchemaVersion({ schemaVersion: toVersionX, upgrade: 2 }), Message._withSchemaVersion({ schemaVersion: toVersionX, upgrade: 2 }),

@ -14,7 +14,7 @@ describe('InboxView', () => {
inboxView = new Whisper.InboxView({ inboxView = new Whisper.InboxView({
model: {}, model: {},
window, window,
initialLoadComplete() {}, initialLoadComplete() { },
}).render(); }).render();
conversation = new Whisper.Conversation({ conversation = new Whisper.Conversation({

@ -174,7 +174,7 @@ describe('NetworkStatusView', () => {
/Attempting reconnect/ /Attempting reconnect/
); );
}); });
it('should be reset by changing the socketStatus to CONNECTING', () => {}); it('should be reset by changing the socketStatus to CONNECTING', () => { });
}); });
}); });
}); });

Loading…
Cancel
Save