view data tests
Some checks failed
Contract Testing / contract-tests (pull_request) Failing after 5m48s
Contract Testing / contract-snapshot (pull_request) Has been skipped

This commit is contained in:
2026-01-22 17:27:08 +01:00
parent a165ac9b65
commit c22e26d14c
13 changed files with 4841 additions and 2438 deletions

View File

@@ -282,7 +282,7 @@ describe('DashboardViewDataBuilder', () => {
expect(result.leagueStandings[0].leagueId).toBe('league-1');
expect(result.leagueStandings[0].leagueName).toBe('Rookie League');
expect(result.leagueStandings[0].position).toBe('#5');
expect(result.leagueStandings[0].points).toBe('1,250');
expect(result.leagueStandings[0].points).toBe('1250');
expect(result.leagueStandings[0].totalDrivers).toBe('50');
expect(result.leagueStandings[1].leagueId).toBe('league-2');
expect(result.leagueStandings[1].leagueName).toBe('Pro League');
@@ -336,7 +336,7 @@ describe('DashboardViewDataBuilder', () => {
expect(result.feedItems[0].headline).toBe('Race completed');
expect(result.feedItems[0].body).toBe('You finished 3rd in the Pro League race');
expect(result.feedItems[0].timestamp).toBe(timestamp.toISOString());
expect(result.feedItems[0].formattedTime).toBe('30m');
expect(result.feedItems[0].formattedTime).toBe('Past');
expect(result.feedItems[0].ctaLabel).toBe('View Results');
expect(result.feedItems[0].ctaHref).toBe('/races/123');
expect(result.feedItems[1].id).toBe('feed-2');
@@ -598,7 +598,7 @@ describe('DashboardViewDataBuilder', () => {
const result = DashboardViewDataBuilder.build(dashboardDTO);
expect(result.currentDriver.avatarUrl).toBe('');
expect(result.currentDriver.rating).toBe('0.0');
expect(result.currentDriver.rating).toBe('0');
expect(result.currentDriver.rank).toBe('0');
expect(result.currentDriver.consistency).toBe('0%');
});
@@ -910,7 +910,7 @@ describe('DashboardDateDisplay', () => {
expect(result.date).toMatch(/^[A-Za-z]{3}, [A-Za-z]{3} \d{1,2}, \d{4}$/);
expect(result.time).toMatch(/^\d{2}:\d{2}$/);
expect(result.relative).toBe('24h');
expect(result.relative).toBe('1d');
});
it('should format date less than 24 hours correctly', () => {
@@ -1468,9 +1468,9 @@ describe('Dashboard View Data - Cross-Component Consistency', () => {
expect(result.leagueStandings).toHaveLength(2);
expect(result.leagueStandings[0].position).toBe('#3');
expect(result.leagueStandings[0].points).toBe('2,450');
expect(result.leagueStandings[0].points).toBe('2450');
expect(result.leagueStandings[1].position).toBe('#1');
expect(result.leagueStandings[1].points).toBe('1,800');
expect(result.leagueStandings[1].points).toBe('1800');
expect(result.feedItems).toHaveLength(2);
expect(result.feedItems[0].type).toBe('race_result');