Fixes for tests

This commit is contained in:
David Bomba 2023-09-14 16:04:15 +10:00
parent a6945fea11
commit fb33fadae3

View File

@ -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();
}