From d6a0bfb8902e1e1ea635a0d1b26726c0a01f1806 Mon Sep 17 00:00:00 2001 From: Vasyka Date: Thu, 28 May 2026 07:14:20 +0000 Subject: [PATCH] fix: repair 4 pre-existing failing tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - WorkOrderCalcTest: vehicle fixture used `brand` (column is `make`, NOT NULL) and WorkOrderPart used `price`/manual total (column is `sell_price`, total is auto-computed). Switched to correct columns + valid status. - ExampleTest: stock test expected 200 on `/` but the central domain redirects to /admin. Replaced with a deterministic central-root → /admin redirect check. Full suite now green: 99 passed, 0 failed. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/Feature/ExampleTest.php | 8 ++++---- tests/Feature/WorkOrderCalcTest.php | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index 8364a84..5a0b7c1 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -8,12 +8,12 @@ use Tests\TestCase; class ExampleTest extends TestCase { /** - * A basic test example. + * On the central domain, the root path redirects to the admin panel. */ - public function test_the_application_returns_a_successful_response(): void + public function test_central_root_redirects_to_admin(): void { - $response = $this->get('/'); + $response = $this->get('http://service.mir.md/'); - $response->assertStatus(200); + $response->assertRedirect('/admin'); } } diff --git a/tests/Feature/WorkOrderCalcTest.php b/tests/Feature/WorkOrderCalcTest.php index 493538c..73fb34a 100644 --- a/tests/Feature/WorkOrderCalcTest.php +++ b/tests/Feature/WorkOrderCalcTest.php @@ -50,9 +50,8 @@ class WorkOrderCalcTest extends TestCase 'work_order_id' => $wo->id, 'name' => 'Filtru', 'qty' => 2, - 'price' => 150, - 'total' => 300, - 'status' => 'pending', + 'sell_price' => 150, + 'status' => 'needed', ]); $wo->refresh(); @@ -93,7 +92,7 @@ class WorkOrderCalcTest extends TestCase $vehicle = Vehicle::create([ 'client_id' => $client->id, 'plate' => 'TST 001', - 'brand' => 'Test', + 'make' => 'Test', 'model' => 'X', ]);