ConversationAttributes typofix

pull/1199/head
Vincent 5 years ago
parent 7498a255a2
commit e4cf21b2de

@ -23,10 +23,20 @@ describe('Sync Message Utils', () => {
const numConversations = 20; const numConversations = 20;
const primaryConversations = new Array(numConversations / 2) const primaryConversations = new Array(numConversations / 2)
.fill({}) .fill({})
.map(() => new TestUtils.MockConversation({ type: TestUtils.MockConversationType.Primary })); .map(
() =>
new TestUtils.MockConversation({
type: TestUtils.MockConversationType.Primary,
})
);
const secondaryConversations = new Array(numConversations / 2) const secondaryConversations = new Array(numConversations / 2)
.fill({}) .fill({})
.map(() => new TestUtils.MockConversation({ type: TestUtils.MockConversationType.Secondary })); .map(
() =>
new TestUtils.MockConversation({
type: TestUtils.MockConversationType.Secondary,
})
);
const conversations = [...primaryConversations, ...secondaryConversations]; const conversations = [...primaryConversations, ...secondaryConversations];
const sandbox = sinon.createSandbox(); const sandbox = sinon.createSandbox();

@ -6,7 +6,7 @@ import {
import { v4 as uuid } from 'uuid'; import { v4 as uuid } from 'uuid';
import { OpenGroup } from '../../../session/types'; import { OpenGroup } from '../../../session/types';
import { generateFakePubKey, generateFakePubKeys } from './pubkey'; import { generateFakePubKey, generateFakePubKeys } from './pubkey';
import { ConversationAttributes } from '../../../../js/models/conversation'; import { ConversationAttributes } from '../../../../js/models/conversations';
export function generateChatMessage(identifier?: string): ChatMessage { export function generateChatMessage(identifier?: string): ChatMessage {
return new ChatMessage({ return new ChatMessage({
@ -73,9 +73,10 @@ export class MockConversation {
this.id = params.id ?? generateFakePubKey().key; this.id = params.id ?? generateFakePubKey().key;
this.isPrimary = this.type === MockConversationType.Primary; this.isPrimary = this.type === MockConversationType.Primary;
const members = this.type === MockConversationType.Group const members =
? params.members ?? generateFakePubKeys(10).map(m => m.key) this.type === MockConversationType.Group
: []; ? params.members ?? generateFakePubKeys(10).map(m => m.key)
: [];
this.attributes = { this.attributes = {
members, members,

Loading…
Cancel
Save