[Tests] Fix tests after adding chat stack history

This commit is contained in:
Alexander Zinchuk 2021-08-04 23:34:19 +03:00
parent 3b01b58b60
commit 8a92fedbd4

View File

@ -4,7 +4,7 @@ import {
import { ApiMessage, ApiThreadInfo, MAIN_THREAD_ID } from '../../api/types';
import { FocusDirection } from '../../types';
import { MESSAGE_LIST_SLICE, MESSAGE_LIST_VIEWPORT_LIMIT } from '../../config';
import { IS_TEST, MESSAGE_LIST_SLICE, MESSAGE_LIST_VIEWPORT_LIMIT } from '../../config';
import {
selectListedIds,
selectChatMessages,
@ -39,7 +39,7 @@ export function updateCurrentMessageList(
): GlobalState {
const { messageLists } = global.messages;
let newMessageLists: MessageList[] = messageLists;
if (shouldReplaceHistory) {
if (shouldReplaceHistory || IS_TEST) {
newMessageLists = chatId ? [{ chatId, threadId, type }] : [];
} else if (chatId) {
const last = messageLists[messageLists.length - 1];