32 lines
804 B
TypeScript
32 lines
804 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { DashboardPresenter } from './DashboardPresenter';
|
|
import { DashboardDTO } from '../dto/DashboardDTO';
|
|
|
|
describe('DashboardPresenter', () => {
|
|
it('should return the data as is (identity transformation)', () => {
|
|
const presenter = new DashboardPresenter();
|
|
const mockData: DashboardDTO = {
|
|
driver: {
|
|
id: '1',
|
|
name: 'John Doe',
|
|
avatar: 'http://example.com/avatar.png',
|
|
},
|
|
statistics: {
|
|
rating: 1500,
|
|
rank: 10,
|
|
starts: 50,
|
|
wins: 5,
|
|
podiums: 15,
|
|
leagues: 3,
|
|
},
|
|
upcomingRaces: [],
|
|
championshipStandings: [],
|
|
recentActivity: [],
|
|
};
|
|
|
|
const result = presenter.present(mockData);
|
|
|
|
expect(result).toBe(mockData);
|
|
});
|
|
});
|