From fb33fadae395d4991ba682149745f1323cbc6dda Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 14 Sep 2023 16:04:15 +1000 Subject: [PATCH] Fixes for tests --- tests/Feature/ClientPortal/InvoicesTest.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/Feature/ClientPortal/InvoicesTest.php b/tests/Feature/ClientPortal/InvoicesTest.php index d1dee684023f..f95a497b4856 100644 --- a/tests/Feature/ClientPortal/InvoicesTest.php +++ b/tests/Feature/ClientPortal/InvoicesTest.php @@ -68,6 +68,8 @@ class InvoicesTest extends TestCase 'user_id' => $user->id, 'company_id' => $company->id, 'client_id' => $client->id, + 'number' => 'testing-number-02', + 'due_date' => now()->addMonth(), 'status_id' => Invoice::STATUS_SENT, ]); @@ -75,6 +77,7 @@ class InvoicesTest extends TestCase 'user_id' => $user->id, 'company_id' => $company->id, 'client_id' => $client->id, + 'number' => 'testing-number-03', 'status_id' => Invoice::STATUS_PAID, ]); @@ -82,10 +85,16 @@ class InvoicesTest extends TestCase 'user_id' => $user->id, 'company_id' => $company->id, 'client_id' => $client->id, + 'number' => 'testing-number-04', + 'due_date' => '', 'status_id' => Invoice::STATUS_UNPAID, ]); - $this->actingAs($client->contacts->first(), 'contact'); + $sent->load('client'); + $paid->load('client'); + $unpaid->load('client'); + + $this->actingAs($client->contacts()->first(), 'contact'); Livewire::test(InvoicesTable::class, ['company_id' => $company->id, 'db' => $company->db]) ->assertSee($sent->number) @@ -97,7 +106,6 @@ class InvoicesTest extends TestCase ->assertSee($paid->number) ->assertDontSee($unpaid->number); - $user->forceDelete(); }