resolve manual DTOs
This commit is contained in:
@@ -6,9 +6,9 @@ describe('MediaViewModel', () => {
|
||||
const dto = {
|
||||
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,
|
||||
};
|
||||
|
||||
@@ -26,8 +26,8 @@ describe('MediaViewModel', () => {
|
||||
const dto = {
|
||||
id: 'media-123',
|
||||
url: 'https://example.com/image.jpg',
|
||||
type: 'image' as const,
|
||||
uploadedAt: new Date('2023-01-15'),
|
||||
type: 'image',
|
||||
uploadedAt: '2023-01-15T00:00:00.000Z',
|
||||
};
|
||||
|
||||
const viewModel = new MediaViewModel(dto);
|
||||
@@ -41,7 +41,7 @@ describe('MediaViewModel', () => {
|
||||
id: 'media-123',
|
||||
url: 'https://example.com/image.jpg',
|
||||
type: 'image',
|
||||
uploadedAt: new Date(),
|
||||
uploadedAt: new Date().toISOString(),
|
||||
});
|
||||
|
||||
expect(viewModel.formattedSize).toBe('Unknown');
|
||||
@@ -52,7 +52,7 @@ describe('MediaViewModel', () => {
|
||||
id: 'media-123',
|
||||
url: 'https://example.com/image.jpg',
|
||||
type: 'image',
|
||||
uploadedAt: new Date(),
|
||||
uploadedAt: new Date().toISOString(),
|
||||
size: 512000, // 500 KB
|
||||
});
|
||||
|
||||
@@ -64,7 +64,7 @@ describe('MediaViewModel', () => {
|
||||
id: 'media-123',
|
||||
url: 'https://example.com/image.jpg',
|
||||
type: 'image',
|
||||
uploadedAt: new Date(),
|
||||
uploadedAt: new Date().toISOString(),
|
||||
size: 2048000, // 2 MB
|
||||
});
|
||||
|
||||
@@ -76,7 +76,7 @@ describe('MediaViewModel', () => {
|
||||
id: 'media-123',
|
||||
url: 'https://example.com/image.jpg',
|
||||
type: 'image',
|
||||
uploadedAt: new Date(),
|
||||
uploadedAt: new Date().toISOString(),
|
||||
size: 1024, // 1 KB
|
||||
});
|
||||
|
||||
@@ -88,7 +88,7 @@ describe('MediaViewModel', () => {
|
||||
id: 'media-123',
|
||||
url: 'https://example.com/video.mp4',
|
||||
type: 'video',
|
||||
uploadedAt: new Date(),
|
||||
uploadedAt: new Date().toISOString(),
|
||||
size: 104857600, // 100 MB
|
||||
});
|
||||
|
||||
@@ -100,19 +100,19 @@ describe('MediaViewModel', () => {
|
||||
id: '1',
|
||||
url: 'image.jpg',
|
||||
type: 'image',
|
||||
uploadedAt: new Date(),
|
||||
uploadedAt: new Date().toISOString(),
|
||||
});
|
||||
const videoVm = new MediaViewModel({
|
||||
id: '2',
|
||||
url: 'video.mp4',
|
||||
type: 'video',
|
||||
uploadedAt: new Date(),
|
||||
uploadedAt: new Date().toISOString(),
|
||||
});
|
||||
const docVm = new MediaViewModel({
|
||||
id: '3',
|
||||
url: 'doc.pdf',
|
||||
type: 'document',
|
||||
uploadedAt: new Date(),
|
||||
uploadedAt: new Date().toISOString(),
|
||||
});
|
||||
|
||||
expect(imageVm.type).toBe('image');
|
||||
@@ -129,7 +129,7 @@ describe('MediaViewModel', () => {
|
||||
url: 'https://example.com/image.jpg',
|
||||
type: 'image',
|
||||
category,
|
||||
uploadedAt: new Date(),
|
||||
uploadedAt: new Date().toISOString(),
|
||||
});
|
||||
|
||||
expect(viewModel.category).toBe(category);
|
||||
|
||||
Reference in New Issue
Block a user