Fixes for tests

This commit is contained in:
David Bomba 2024-06-18 11:48:04 +10:00
parent 7623246424
commit 99bf34b20f
2 changed files with 13 additions and 16 deletions

View File

@ -99,7 +99,19 @@ class PurchaseOrderTest extends TestCase
{ {
$this->purchase_order->service()->createInvitations()->save(); $this->purchase_order->service()->createInvitations()->save();
$i = $this->purchase_order->fresh()->invitations->first(); $i = $this->purchase_order->invitations->first();
$data = [
'ids' => [$this->purchase_order->hashed_id],
'action' => 'download',
];
$response = $this->withHeaders([
'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $this->token,
])->post("/api/v1/purchase_orders/bulk", $data)
->assertStatus(200);
$data = [ $data = [
'ids' =>[$this->purchase_order->hashed_id], 'ids' =>[$this->purchase_order->hashed_id],
@ -146,16 +158,6 @@ class PurchaseOrderTest extends TestCase
])->post("/api/v1/purchase_orders/bulk", $data) ])->post("/api/v1/purchase_orders/bulk", $data)
->assertStatus(200); ->assertStatus(200);
$data = [
'ids' =>[$this->purchase_order->hashed_id],
'action' => 'download',
];
$response = $this->withHeaders([
'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $this->token,
])->post("/api/v1/purchase_orders/bulk", $data)
->assertStatus(200);
$data = [ $data = [
'ids' =>[], 'ids' =>[],

View File

@ -600,11 +600,6 @@ trait MockAccountData
'purchase_order_id' => $this->purchase_order->id, 'purchase_order_id' => $this->purchase_order->id,
]); ]);
$purchase_order_invitations = PurchaseOrderInvitation::whereCompanyId($this->purchase_order->company_id)
->wherePurchaseOrderId($this->purchase_order->id);
$this->purchase_order->setRelation('invitations', $purchase_order_invitations);
$this->purchase_order->service()->markSent(); $this->purchase_order->service()->markSent();
$this->purchase_order->setRelation('vendor', $this->vendor); $this->purchase_order->setRelation('vendor', $this->vendor);