add notes/remark and refactor round-trip
PHP Tests / php-tests (push) Has been cancelled

This commit is contained in:
Nyan Lin Paing
2026-08-22 21:43:41 +07:00
parent 894352b43f
commit fa908cdcaf
46 changed files with 1679 additions and 182 deletions
@@ -41,6 +41,39 @@ test('can list ev routes', function () {
->assertCanSeeTableRecords($routes);
});
test('can filter ev routes by company, from, and to', function () {
$companyA = EvCompany::factory()->create();
$companyB = EvCompany::factory()->create();
$yangon = Destination::factory()->create();
$mandalay = Destination::factory()->create();
$bagan = Destination::factory()->create();
$matching = EvRoute::factory()->create([
'ev_company_id' => $companyA->id,
'from_destination_id' => $yangon->id,
'to_destination_id' => $mandalay->id,
]);
$wrongCompany = EvRoute::factory()->create([
'ev_company_id' => $companyB->id,
'from_destination_id' => $yangon->id,
'to_destination_id' => $mandalay->id,
]);
$wrongDestination = EvRoute::factory()->create([
'ev_company_id' => $companyA->id,
'from_destination_id' => $yangon->id,
'to_destination_id' => $bagan->id,
]);
Livewire::test(ListEvRoutes::class)
->filterTable('ev_company_id', $companyA->id)
->filterTable('from_destination_id', $yangon->id)
->filterTable('to_destination_id', $mandalay->id)
->assertCanSeeTableRecords([$matching])
->assertCanNotSeeTableRecords([$wrongCompany, $wrongDestination]);
});
test('list shows each vehicle option price stacked, and blocked options instead of a price', function () {
$route = EvRoute::factory()->create();
@@ -63,7 +96,6 @@ test('creating a route also creates all three vehicle option pricing rows, defau
'ev_company_id' => $company->id,
'from_destination_id' => $from->id,
'to_destination_id' => $to->id,
'is_round_trip' => false,
'is_active' => false,
'pricing' => pricingPayload(),
])