Move getDefaultConversation into a shared test folder

This commit is contained in:
Evan Hahn
2020-12-18 13:16:44 -06:00
committed by Scott Nonnenberg
parent dd0ea6b3fe
commit 8e7379a591
7 changed files with 6 additions and 12 deletions

View File

@@ -17,7 +17,7 @@ import {
} from '../types/Calling';
import { ConversationTypeType } from '../state/ducks/conversations';
import { Colors, ColorType } from '../types/Colors';
import { getDefaultConversation } from '../util/getDefaultConversation';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import { setup as setupI18n } from '../../js/modules/i18n';
import { Props as SafetyNumberViewerProps } from '../state/smart/SafetyNumberViewer';
import enMessages from '../../_locales/en/messages.json';

View File

@@ -19,7 +19,7 @@ import { Colors } from '../types/Colors';
import { CallScreen, PropsType } from './CallScreen';
import { setup as setupI18n } from '../../js/modules/i18n';
import { missingCaseError } from '../util/missingCaseError';
import { getDefaultConversation } from '../util/getDefaultConversation';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View File

@@ -12,7 +12,7 @@ import { ConversationType } from '../state/ducks/conversations';
import { CallingLobby, PropsType } from './CallingLobby';
import { setup as setupI18n } from '../../js/modules/i18n';
import enMessages from '../../_locales/en/messages.json';
import { getDefaultConversation } from '../util/getDefaultConversation';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
const i18n = setupI18n('en', enMessages);

View File

@@ -9,7 +9,7 @@ import { v4 as generateUuid } from 'uuid';
import { CallingParticipantsList, PropsType } from './CallingParticipantsList';
import { Colors } from '../types/Colors';
import { GroupCallRemoteParticipantType } from '../types/Calling';
import { getDefaultConversation } from '../util/getDefaultConversation';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import { setup as setupI18n } from '../../js/modules/i18n';
import enMessages from '../../_locales/en/messages.json';

View File

@@ -9,7 +9,7 @@ import {
GroupCallRemoteParticipant,
PropsType,
} from './GroupCallRemoteParticipant';
import { getDefaultConversation } from '../util/getDefaultConversation';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import { setup as setupI18n } from '../../js/modules/i18n';
import enMessages from '../../_locales/en/messages.json';

View File

@@ -2,15 +2,11 @@
// SPDX-License-Identifier: AGPL-3.0-only
import { v4 as generateUuid } from 'uuid';
import { ConversationType } from '../state/ducks/conversations';
import { ConversationType } from '../../state/ducks/conversations';
export function getDefaultConversation(
overrideProps: Partial<ConversationType>
): ConversationType {
if (window.STORYBOOK_ENV !== 'react') {
throw new Error('getDefaultConversation is for storybook only');
}
return {
id: 'guid-1',
lastUpdated: Date.now(),

2
ts/window.d.ts vendored
View File

@@ -478,8 +478,6 @@ declare global {
getServerTrustRoot: () => WhatIsThis;
readyForUpdates: () => void;
STORYBOOK_ENV?: string;
// Flags
isGroupCallingEnabled: () => boolean;
}