feat: show the travel name above the mailing list

This commit is contained in:
fromme committed 2026-10-14 14:05:42 +02:00
1 parent d305774bee
commit ff722b5cef
5 files changed
+87 -4

No files matched your search

+38
View File
@@ -148,6 +148,44 @@ class TravelIndexTest extends TestCase
$this->assertNull($result);
}
// -------------------------------------------------------------------------
// mapDateCodeToLabel
// -------------------------------------------------------------------------
public function testMapDateCodeToLabelReturnsTheTravelLabel(): void
{
$this->travelLoader->method('generateFilesMap')->willReturn([
42 => ['id' => 42, 'code' => 'WI25', 'label' => 'Davos - Sportclub Waldschlössli - Wochenende', 'hotels' => []],
]);
$this->travelSnapshotService->method('generateMapping')->willReturn([]);
$result = $this->service()->mapDateCodeToLabel('WI25');
$this->assertSame('Davos - Sportclub Waldschlössli - Wochenende', $result);
}
public function testMapDateCodeToLabelReturnsNullWhenNotFound(): void
{
$this->travelLoader->method('generateFilesMap')->willReturn([]);
$this->travelSnapshotService->method('generateMapping')->willReturn([]);
$result = $this->service()->mapDateCodeToLabel('UNKNOWN');
$this->assertNull($result);
}
public function testMapDateCodeToLabelReturnsNullWhenTheTravelHasNoLabel(): void
{
$this->travelLoader->method('generateFilesMap')->willReturn([
42 => ['id' => 42, 'code' => 'WI25', 'label' => null, 'hotels' => []],
]);
$this->travelSnapshotService->method('generateMapping')->willReturn([]);
$result = $this->service()->mapDateCodeToLabel('WI25');
$this->assertNull($result);
}
// -------------------------------------------------------------------------
// mapHotelCodeToId
// -------------------------------------------------------------------------