resolve manual DTOs
This commit is contained in:
@@ -83,9 +83,9 @@ describe('MediaService', () => {
|
||||
const expectedOutput = {
|
||||
id: 'media-123',
|
||||
url: 'https://example.com/image.jpg',
|
||||
type: 'image' as const,
|
||||
category: 'avatar' as const,
|
||||
uploadedAt: new Date('2023-01-15'),
|
||||
type: 'image',
|
||||
category: 'avatar',
|
||||
uploadedAt: '2023-01-15T00:00:00.000Z',
|
||||
size: 2048000,
|
||||
};
|
||||
mockApiClient.getMedia.mockResolvedValue(expectedOutput);
|
||||
@@ -98,7 +98,7 @@ describe('MediaService', () => {
|
||||
expect(result.url).toBe('https://example.com/image.jpg');
|
||||
expect(result.type).toBe('image');
|
||||
expect(result.category).toBe('avatar');
|
||||
expect(result.uploadedAt).toEqual(new Date('2023-01-15'));
|
||||
expect(result.uploadedAt).toEqual(new Date('2023-01-15T00:00:00.000Z'));
|
||||
expect(result.size).toBe(2048000);
|
||||
expect(result.formattedSize).toBe('2000.00 KB');
|
||||
});
|
||||
@@ -109,8 +109,8 @@ describe('MediaService', () => {
|
||||
const expectedOutput = {
|
||||
id: 'media-456',
|
||||
url: 'https://example.com/video.mp4',
|
||||
type: 'video' as const,
|
||||
uploadedAt: new Date('2023-02-20'),
|
||||
type: 'video',
|
||||
uploadedAt: '2023-02-20T00:00:00.000Z',
|
||||
};
|
||||
mockApiClient.getMedia.mockResolvedValue(expectedOutput);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user