Fixes for tests

This commit is contained in:
David Bomba 2023-04-13 16:11:38 +10:00
parent 35b1aaf507
commit ee837b7cdd
2 changed files with 20 additions and 7 deletions

View File

@ -50,7 +50,8 @@ class EmailProductSalesReport
'start_date' => $start_end_dates[0],
'end_date' => $start_end_dates[1],
'date_range' => 'custom',
'client_id' => null
'client_id' => null,
'report_keys' => []
];
$export = (new ProductSalesExport($this->scheduler->company, $data));

View File

@ -54,6 +54,8 @@ class SchedulerTest extends TestCase
$this->withoutMiddleware(
ThrottleRequests::class
);
// $this->withoutExceptionHandling();
}
@ -67,15 +69,25 @@ class SchedulerTest extends TestCase
'parameters' => [
'date_range' => EmailStatement::LAST_MONTH,
'clients' => [],
'report_keys' => [],
'client_id' => null,
],
];
$response = false;
try {
$response = $this->withHeaders([
'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $this->token,
])->postJson('/api/v1/task_schedulers', $data);
$response->assertStatus(200);
}
catch(\Exception $e){
nlog($e->getMessage());
}
$arr = $response->json();