mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-03 06:41:19 +01:00
Use UUIDs in group database schema
This commit is contained in:
@@ -5,11 +5,10 @@ import { assert } from 'chai';
|
||||
|
||||
import type { ConversationType } from '../../state/ducks/conversations';
|
||||
import { MemberRepository } from '../../quill/memberRepository';
|
||||
import { getDefaultConversation } from '../../test-both/helpers/getDefaultConversation';
|
||||
import { getDefaultConversationWithUuid } from '../../test-both/helpers/getDefaultConversation';
|
||||
|
||||
const memberMahershala: ConversationType = getDefaultConversation({
|
||||
const memberMahershala: ConversationType = getDefaultConversationWithUuid({
|
||||
id: '555444',
|
||||
uuid: 'abcdefg',
|
||||
title: 'Pal',
|
||||
firstName: 'Mahershala',
|
||||
profileName: 'Mr Ali',
|
||||
@@ -20,9 +19,8 @@ const memberMahershala: ConversationType = getDefaultConversation({
|
||||
areWeAdmin: false,
|
||||
});
|
||||
|
||||
const memberShia: ConversationType = getDefaultConversation({
|
||||
const memberShia: ConversationType = getDefaultConversationWithUuid({
|
||||
id: '333222',
|
||||
uuid: 'hijklmno',
|
||||
title: 'Buddy',
|
||||
firstName: 'Shia',
|
||||
profileName: 'Sr LaBeouf',
|
||||
@@ -35,9 +33,8 @@ const memberShia: ConversationType = getDefaultConversation({
|
||||
|
||||
const members: Array<ConversationType> = [memberMahershala, memberShia];
|
||||
|
||||
const singleMember: ConversationType = getDefaultConversation({
|
||||
const singleMember: ConversationType = getDefaultConversationWithUuid({
|
||||
id: '666777',
|
||||
uuid: 'pqrstuv',
|
||||
title: 'The Guy',
|
||||
firstName: 'Jeff',
|
||||
profileName: 'Jr Klaus',
|
||||
@@ -85,7 +82,7 @@ describe('MemberRepository', () => {
|
||||
|
||||
it('returns a matched member', () => {
|
||||
const memberRepository = new MemberRepository(members);
|
||||
assert.isDefined(memberRepository.getMemberByUuid('abcdefg'));
|
||||
assert.isDefined(memberRepository.getMemberByUuid(memberMahershala.uuid));
|
||||
});
|
||||
|
||||
it('returns undefined when it does not have the member', () => {
|
||||
|
||||
Reference in New Issue
Block a user