2023-01-03 11:55:46 -08:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
2021-10-05 15:10:08 -07:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2024-06-21 15:35:18 -07:00
|
|
|
import { v4 as generateUuid } from 'uuid';
|
|
|
|
|
2021-11-15 13:54:33 -08:00
|
|
|
import type {
|
|
|
|
AttachmentType,
|
|
|
|
AttachmentDraftType,
|
2022-03-04 16:14:52 -05:00
|
|
|
ThumbnailType,
|
2024-07-16 16:39:56 -04:00
|
|
|
AttachmentForUIType,
|
2021-11-15 13:54:33 -08:00
|
|
|
} from '../../types/Attachment';
|
2021-10-05 15:10:08 -07:00
|
|
|
import { IMAGE_JPEG } from '../../types/MIME';
|
|
|
|
|
|
|
|
export const fakeAttachment = (
|
|
|
|
overrides: Partial<AttachmentType> = {}
|
2024-07-16 16:39:56 -04:00
|
|
|
): AttachmentForUIType => ({
|
2021-10-05 15:10:08 -07:00
|
|
|
contentType: IMAGE_JPEG,
|
|
|
|
width: 800,
|
|
|
|
height: 600,
|
|
|
|
size: 10304,
|
2023-10-30 09:24:28 -07:00
|
|
|
// This is to get rid of the download buttons on most of our stories
|
|
|
|
path: 'ab/ablahblahblah',
|
2021-10-05 15:10:08 -07:00
|
|
|
...overrides,
|
|
|
|
});
|
2021-11-15 13:54:33 -08:00
|
|
|
|
2022-03-04 16:14:52 -05:00
|
|
|
export const fakeThumbnail = (url: string): ThumbnailType => ({
|
|
|
|
contentType: IMAGE_JPEG,
|
|
|
|
height: 100,
|
|
|
|
path: url,
|
|
|
|
url,
|
|
|
|
width: 100,
|
2024-05-23 17:06:41 -04:00
|
|
|
size: 128,
|
2022-03-04 16:14:52 -05:00
|
|
|
});
|
|
|
|
|
2021-11-15 13:54:33 -08:00
|
|
|
export const fakeDraftAttachment = (
|
|
|
|
overrides: Partial<AttachmentDraftType> = {}
|
|
|
|
): AttachmentDraftType => ({
|
|
|
|
pending: false,
|
2024-06-21 15:35:18 -07:00
|
|
|
clientUuid: generateUuid(),
|
2021-11-15 13:54:33 -08:00
|
|
|
contentType: IMAGE_JPEG,
|
|
|
|
path: 'file.jpg',
|
|
|
|
size: 10304,
|
|
|
|
...overrides,
|
|
|
|
});
|