Fixes for Yodlee tests

This commit is contained in:
David Bomba 2022-10-26 14:03:49 +11:00
parent 17d90c0291
commit 2bf1435750
2 changed files with 12 additions and 9 deletions

View File

@ -37,7 +37,9 @@ class BankTransactionTest extends TestCase
public function testMatchBankTransactionsValidationShouldFail()
{
$data = [
$data = [];
$data['transactions'][] = [
'bad_key' => 10,
];
@ -52,13 +54,12 @@ class BankTransactionTest extends TestCase
public function testMatchBankTransactionValidationShouldPass()
{
$data = [
$data = [];
$data['transactions'][] = [
'id' => $this->bank_transaction->hashed_id,
];
nlog($this->bank_transaction->hashed_id);
$response = $this->withHeaders([
'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $this->token,

View File

@ -58,16 +58,18 @@ class YodleeApiTest extends TestCase
$bt->date = now()->format('Y-m-d');
$bt->transaction_id = 1234567890;
$bt->category_id = 10000003;
$bt->base_type = 'DEBIT';
$bt->save();
$data = [
$data = [];
$data['transactions'][] = [
'id' => $bt->id,
];
MatchBankTransactions::dispatchSync($this->company->id, $this->company->db, $data);
$expense = Expense::where('public_notes', 'Fuel')->first();
$expense = Expense::where('transaction_reference', 'Fuel')->first();
$this->assertNotNull($expense);
$this->assertEquals(10, (int)$expense->amount);
@ -116,7 +118,7 @@ class YodleeApiTest extends TestCase
$bt->transaction_id = 123456;
$bt->save();
$data = [
$data['transactions'][] = [
'id' => $bt->id,
'invoice_ids' => $invoice->hashed_id
];