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 primaryConversations = new Array(numConversations / 2)
.fill({})
.map(() => new TestUtils.MockConversation({ type: TestUtils.MockConversationType.Primary }));
.map(
() =>
new TestUtils.MockConversation({
type: TestUtils.MockConversationType.Primary,
})
);
const secondaryConversations = new Array(numConversations / 2)
.fill({})
.map(() => new TestUtils.MockConversation({ type: TestUtils.MockConversationType.Secondary }));
.map(
() =>
new TestUtils.MockConversation({
type: TestUtils.MockConversationType.Secondary,
})
);
const conversations = [...primaryConversations, ...secondaryConversations];
const sandbox = sinon.createSandbox();

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

Loading…
Cancel
Save