feat: toon vandaag ook in de 5-daagse verwachting (nu 6 dagen)

ForecastMapper mapt voortaan index 0 t/m 5 van Open-Meteo (was 1 t/m 5),
zodat vandaag als eerste kolom in de verwachtingsstrook verschijnt naast
de bestaande 5 dagen erna. Verwachtingskolommen gaan van 5 naar 6 breed
(103px i.p.v. 124px), weericoon iets verkleind (58 -> 50px) om te passen.
Spec bijgewerkt om de wijziging vast te leggen. Service-worker-versie naar
v4 zodat het scherm dit zelf binnen enkele minuten oppikt.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-13 10:01:14 +02:00
co-authored by Claude Sonnet 5
parent 281eb1406f
commit 8bbfd62d16
6 changed files with 22 additions and 21 deletions
+2 -2
View File
@@ -63,8 +63,8 @@ final class DashboardServiceTest extends TestCase
self::assertSame(['2026-09-08', '2026-09-09', '2026-09-10'], array_column($p['rain']['previous_days'], 'date'));
self::assertEqualsWithDelta(38.5, $p['rain']['month_total'], 0.0001);
self::assertFalse($p['rain']['stale']);
self::assertCount(5, $p['forecast']);
self::assertSame('2026-09-12', $p['forecast'][0]['date']);
self::assertCount(6, $p['forecast']);
self::assertSame('2026-09-11', $p['forecast'][0]['date']);
self::assertFalse($p['forecast_stale']);
self::assertSame([], $p['errors']);
}
+9 -9
View File
@@ -15,16 +15,16 @@ final class ForecastMapperTest extends TestCase
return json_decode((string) file_get_contents(__DIR__ . '/fixtures/forecast.json'), true)['daily'];
}
public function testSkipsTodayAndReturnsFiveDays(): void
public function testIncludesTodayAndReturnsSixDays(): void
{
$f = ForecastMapper::map($this->daily());
self::assertCount(5, $f);
self::assertCount(6, $f);
self::assertSame([
'date' => '2026-09-12', 'weather_code' => 2, 'temp_max' => 18.3, 'temp_min' => 10.1,
'precip_mm' => 0.4, 'precip_prob' => 20,
'date' => '2026-09-11', 'weather_code' => 3, 'temp_max' => 17.9, 'temp_min' => 11.0,
'precip_mm' => 0.0, 'precip_prob' => 10,
], $f[0]);
self::assertSame('2026-09-16', $f[4]['date']);
self::assertSame('2026-09-16', $f[5]['date']);
}
public function testNullValuesStayNull(): void
@@ -35,9 +35,9 @@ final class ForecastMapperTest extends TestCase
$f = ForecastMapper::map($daily);
self::assertNull($f[2]['weather_code']);
self::assertNull($f[2]['precip_prob']);
self::assertSame(17.4, $f[2]['temp_max']);
self::assertNull($f[3]['weather_code']);
self::assertNull($f[3]['precip_prob']);
self::assertSame(17.4, $f[3]['temp_max']);
}
public function testShorterResponseGivesFewerDays(): void
@@ -47,7 +47,7 @@ final class ForecastMapperTest extends TestCase
$daily[$key] = array_slice($values, 0, 3);
}
self::assertCount(2, ForecastMapper::map($daily));
self::assertCount(3, ForecastMapper::map($daily));
}
public function testMissingTimeArrayGivesEmptyList(): void