Fixes for test seed data

This commit is contained in:
David Bomba 2023-10-26 13:37:03 +11:00
parent a669328a80
commit 60766a7510
2 changed files with 9 additions and 10 deletions

View File

@ -30,6 +30,7 @@ class PaymentFactory extends Factory
'transaction_reference' => $this->faker->text(10), 'transaction_reference' => $this->faker->text(10),
'type_id' => Payment::TYPE_CREDIT_CARD, 'type_id' => Payment::TYPE_CREDIT_CARD,
'status_id' => Payment::STATUS_COMPLETED, 'status_id' => Payment::STATUS_COMPLETED,
'currency_id' => 1,
]; ];
} }
} }

View File

@ -44,6 +44,8 @@ class ClientApiTest extends TestCase
use MockAccountData; use MockAccountData;
use ClientGroupSettingsSaver; use ClientGroupSettingsSaver;
public $faker;
protected function setUp() :void protected function setUp() :void
{ {
parent::setUp(); parent::setUp();
@ -175,20 +177,16 @@ class ClientApiTest extends TestCase
'status' => 'paid', 'status' => 'paid',
]; ];
$response = $this->withHeaders([
'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $this->token,
])->postJson('/api/v1/client_statement', $data);
try { $response->assertStatus(200);
$response = $this->withHeaders([
'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $this->token,
])->postJson('/api/v1/client_statement', $data);
} catch (ValidationException $e) {
$message = json_decode($e->validator->getMessageBag(), 1);
nlog($message);
}
$this->assertTrue($response->headers->get('content-type') == 'application/pdf'); $this->assertTrue($response->headers->get('content-type') == 'application/pdf');
$response->assertStatus(200);
} }
public function testClientStatementEmail() public function testClientStatementEmail()