Make sure that storySendMode is in group types

This commit is contained in:
Fedor Indutny 2022-11-19 00:31:18 -08:00 committed by GitHub
parent fa2fd5eef3
commit a2f1b469ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 101 additions and 110 deletions

View file

@ -10,6 +10,10 @@ import type {
ShallowChallengeError,
} from '../../../model-types.d';
import type { ConversationType } from '../../../state/ducks/conversations';
import {
getDefaultConversation,
getDefaultGroup,
} from '../../../test-both/helpers/getDefaultConversation';
import {
canDeleteForEveryone,
@ -156,15 +160,7 @@ describe('state/selectors/messages', () => {
});
describe('canReact', () => {
const defaultConversation: ConversationType = {
id: uuid(),
type: 'direct',
title: 'Test conversation',
isMe: false,
sharedGroupNames: [],
acceptedMessageRequest: true,
badges: [],
};
const defaultConversation = getDefaultConversation();
it('returns false for disabled v1 groups', () => {
const message = {
@ -172,8 +168,7 @@ describe('state/selectors/messages', () => {
type: 'incoming' as const,
};
const getConversationById = () => ({
...defaultConversation,
type: 'group' as const,
...getDefaultGroup(),
isGroupV1AndDisabled: true,
});
@ -249,8 +244,7 @@ describe('state/selectors/messages', () => {
},
};
const getConversationById = () => ({
...defaultConversation,
type: 'group' as const,
...getDefaultGroup(),
});
assert.isTrue(canReact(message, ourConversationId, getConversationById));
@ -284,8 +278,7 @@ describe('state/selectors/messages', () => {
type: 'incoming' as const,
};
const getConversationById = () => ({
...defaultConversation,
type: 'group' as const,
...getDefaultGroup(),
isGroupV1AndDisabled: true,
});
@ -360,10 +353,7 @@ describe('state/selectors/messages', () => {
},
},
};
const getConversationById = () => ({
...defaultConversation,
type: 'group' as const,
});
const getConversationById = () => getDefaultGroup();
assert.isTrue(canReply(message, ourConversationId, getConversationById));
});