Fixes for tests

This commit is contained in:
David Bomba 2023-01-19 08:25:15 +11:00
parent 1ebcec885b
commit 1e7f750a1b

View File

@ -118,6 +118,13 @@ class ProductSalesReportTest extends TestCase
'is_income_billed' => true,
'include_tax' => false,
];
$this->client = Client::factory()->create([
'user_id' => $this->user->id,
'company_id' => $this->company->id,
'is_deleted' => 0,
]);
}
public function testProductSalesInstance()
@ -128,29 +135,24 @@ class ProductSalesReportTest extends TestCase
$this->assertInstanceOf(ProductSalesExport::class, $pl);
// $this->account->delete();
$this->account->delete();
}
public function testSimpleReport()
{
$this->buildData();
$client = Client::factory()->create([
'user_id' => $this->user->id,
'company_id' => $this->company->id,
'is_deleted' => 0,
]);
$this->payload = [
'start_date' => '2000-01-01',
'end_date' => '2030-01-11',
'date_range' => 'custom',
'client_id' => $client->id,
'client_id' => $this->client->id,
'report_keys' => []
];
$i = Invoice::factory()->create([
'client_id' => $client->id,
'client_id' => $this->client->id,
'user_id' => $this->user->id,
'company_id' => $this->company->id,
'amount' => 0,