Move getDefaultConversation
into a shared test folder
This commit is contained in:
parent
dd0ea6b3fe
commit
8e7379a591
7 changed files with 6 additions and 12 deletions
|
@ -17,7 +17,7 @@ import {
|
||||||
} from '../types/Calling';
|
} from '../types/Calling';
|
||||||
import { ConversationTypeType } from '../state/ducks/conversations';
|
import { ConversationTypeType } from '../state/ducks/conversations';
|
||||||
import { Colors, ColorType } from '../types/Colors';
|
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 { setup as setupI18n } from '../../js/modules/i18n';
|
||||||
import { Props as SafetyNumberViewerProps } from '../state/smart/SafetyNumberViewer';
|
import { Props as SafetyNumberViewerProps } from '../state/smart/SafetyNumberViewer';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
|
@ -19,7 +19,7 @@ import { Colors } from '../types/Colors';
|
||||||
import { CallScreen, PropsType } from './CallScreen';
|
import { CallScreen, PropsType } from './CallScreen';
|
||||||
import { setup as setupI18n } from '../../js/modules/i18n';
|
import { setup as setupI18n } from '../../js/modules/i18n';
|
||||||
import { missingCaseError } from '../util/missingCaseError';
|
import { missingCaseError } from '../util/missingCaseError';
|
||||||
import { getDefaultConversation } from '../util/getDefaultConversation';
|
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
const i18n = setupI18n('en', enMessages);
|
const i18n = setupI18n('en', enMessages);
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { ConversationType } from '../state/ducks/conversations';
|
||||||
import { CallingLobby, PropsType } from './CallingLobby';
|
import { CallingLobby, PropsType } from './CallingLobby';
|
||||||
import { setup as setupI18n } from '../../js/modules/i18n';
|
import { setup as setupI18n } from '../../js/modules/i18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
import { getDefaultConversation } from '../util/getDefaultConversation';
|
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
||||||
|
|
||||||
const i18n = setupI18n('en', enMessages);
|
const i18n = setupI18n('en', enMessages);
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { v4 as generateUuid } from 'uuid';
|
||||||
import { CallingParticipantsList, PropsType } from './CallingParticipantsList';
|
import { CallingParticipantsList, PropsType } from './CallingParticipantsList';
|
||||||
import { Colors } from '../types/Colors';
|
import { Colors } from '../types/Colors';
|
||||||
import { GroupCallRemoteParticipantType } from '../types/Calling';
|
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 { setup as setupI18n } from '../../js/modules/i18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {
|
||||||
GroupCallRemoteParticipant,
|
GroupCallRemoteParticipant,
|
||||||
PropsType,
|
PropsType,
|
||||||
} from './GroupCallRemoteParticipant';
|
} from './GroupCallRemoteParticipant';
|
||||||
import { getDefaultConversation } from '../util/getDefaultConversation';
|
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
||||||
import { setup as setupI18n } from '../../js/modules/i18n';
|
import { setup as setupI18n } from '../../js/modules/i18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
|
|
|
@ -2,15 +2,11 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import { v4 as generateUuid } from 'uuid';
|
import { v4 as generateUuid } from 'uuid';
|
||||||
import { ConversationType } from '../state/ducks/conversations';
|
import { ConversationType } from '../../state/ducks/conversations';
|
||||||
|
|
||||||
export function getDefaultConversation(
|
export function getDefaultConversation(
|
||||||
overrideProps: Partial<ConversationType>
|
overrideProps: Partial<ConversationType>
|
||||||
): ConversationType {
|
): ConversationType {
|
||||||
if (window.STORYBOOK_ENV !== 'react') {
|
|
||||||
throw new Error('getDefaultConversation is for storybook only');
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: 'guid-1',
|
id: 'guid-1',
|
||||||
lastUpdated: Date.now(),
|
lastUpdated: Date.now(),
|
2
ts/window.d.ts
vendored
2
ts/window.d.ts
vendored
|
@ -478,8 +478,6 @@ declare global {
|
||||||
getServerTrustRoot: () => WhatIsThis;
|
getServerTrustRoot: () => WhatIsThis;
|
||||||
readyForUpdates: () => void;
|
readyForUpdates: () => void;
|
||||||
|
|
||||||
STORYBOOK_ENV?: string;
|
|
||||||
|
|
||||||
// Flags
|
// Flags
|
||||||
isGroupCallingEnabled: () => boolean;
|
isGroupCallingEnabled: () => boolean;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue