Fixes for bank transaction tests

This commit is contained in:
David Bomba 2022-10-27 12:10:11 +11:00
parent 3e6071d5d4
commit 15b1237e21

View File

@ -12,6 +12,8 @@
namespace Tests\Feature\Bank;
use App\Factory\BankIntegrationFactory;
use App\Factory\BankTransactionFactory;
use App\Models\BankTransaction;
use App\Models\Invoice;
use Illuminate\Foundation\Testing\DatabaseTransactions;
@ -56,8 +58,24 @@ class BankTransactionTest extends TestCase
{
$data = [];
$bi = BankIntegrationFactory::create($this->company->id, $this->user->id, $this->account->id);
$bi->save();
$bt = BankTransactionFactory::create($this->company->id, $this->user->id);
$bt->bank_integration_id = $bi->id;
$bt->description = 'Fuel';
$bt->amount = 10;
$bt->currency_code = $this->client->currency()->code;
$bt->date = now()->format('Y-m-d');
$bt->transaction_id = 1234567890;
$bt->category_id = 10000003;
$bt->base_type = 'DEBIT';
$bt->save();
$data = [];
$data['transactions'][] = [
'id' => $this->bank_transaction->hashed_id,
'id' => $bt->hashed_id,
];
$response = $this->withHeaders([