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
|
@ -1,24 +0,0 @@
|
|||
// Copyright 2020 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
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(),
|
||||
markedUnread: Boolean(overrideProps.markedUnread),
|
||||
e164: '+1300555000',
|
||||
title: 'Alice',
|
||||
type: 'direct' as const,
|
||||
uuid: generateUuid(),
|
||||
...overrideProps,
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue