mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +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', () => {
|
||||
|
||||
@@ -8,7 +8,7 @@ import Delta from 'quill-delta';
|
||||
import { matchMention } from '../../../quill/mentions/matchers';
|
||||
import { MemberRepository } from '../../../quill/memberRepository';
|
||||
import type { ConversationType } from '../../../state/ducks/conversations';
|
||||
import { getDefaultConversation } from '../../../test-both/helpers/getDefaultConversation';
|
||||
import { getDefaultConversationWithUuid } from '../../../test-both/helpers/getDefaultConversation';
|
||||
|
||||
class FakeTokenList<T> extends Array<T> {
|
||||
constructor(elements: Array<T>) {
|
||||
@@ -38,9 +38,8 @@ const createMockMentionBlotElement = (
|
||||
dataset: Record<string, string>
|
||||
): HTMLElement => createMockElement('mention-blot', dataset);
|
||||
|
||||
const memberMahershala: ConversationType = getDefaultConversation({
|
||||
const memberMahershala: ConversationType = getDefaultConversationWithUuid({
|
||||
id: '555444',
|
||||
uuid: 'abcdefg',
|
||||
title: 'Mahershala Ali',
|
||||
firstName: 'Mahershala',
|
||||
profileName: 'Mahershala A.',
|
||||
@@ -50,9 +49,8 @@ const memberMahershala: ConversationType = getDefaultConversation({
|
||||
areWeAdmin: false,
|
||||
});
|
||||
|
||||
const memberShia: ConversationType = getDefaultConversation({
|
||||
const memberShia: ConversationType = getDefaultConversationWithUuid({
|
||||
id: '333222',
|
||||
uuid: 'hijklmno',
|
||||
title: 'Shia LaBeouf',
|
||||
firstName: 'Shia',
|
||||
profileName: 'Shia L.',
|
||||
|
||||
Reference in New Issue
Block a user