From d97f17ea39250738f6472ca2167832ffd1eca31e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 2 Jan 2023 17:55:57 +1100 Subject: [PATCH] Fixes for tests --- VERSION.txt | 2 +- config/ninja.php | 4 +-- tests/Feature/ClientPortal/InvoicesTest.php | 4 +-- .../Export/ProfitAndLossReportTest.php | 28 +++++++++---------- .../GeneratesConvertedQuoteCounterTest.php | 4 +-- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index fd2784a84..6ca7fd49a 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.5.49 \ No newline at end of file +5.5.50 \ No newline at end of file diff --git a/config/ninja.php b/config/ninja.php index 4f6803a67..571db89cd 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,8 +14,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.5.49', - 'app_tag' => '5.5.49', + 'app_version' => '5.5.50', + 'app_tag' => '5.5.50', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''), diff --git a/tests/Feature/ClientPortal/InvoicesTest.php b/tests/Feature/ClientPortal/InvoicesTest.php index 1abde1419..aa606e1f0 100644 --- a/tests/Feature/ClientPortal/InvoicesTest.php +++ b/tests/Feature/ClientPortal/InvoicesTest.php @@ -86,12 +86,12 @@ class InvoicesTest extends TestCase $this->actingAs($client->contacts->first(), 'contact'); - Livewire::test(InvoicesTable::class, ['company_id' => $company->id, 'db' => $db]) + Livewire::test(InvoicesTable::class, ['company_id' => $company->id, 'db' => $company->db]) ->assertSee($sent->number) ->assertSee($paid->number) ->assertSee($unpaid->number); - Livewire::test(InvoicesTable::class, ['company_id' => $company->id, 'db' => $db]) + Livewire::test(InvoicesTable::class, ['company_id' => $company->id, 'db' => $company->db]) ->set('status', ['paid']) ->assertSee($paid->number) ->assertDontSee($unpaid->number); diff --git a/tests/Feature/Export/ProfitAndLossReportTest.php b/tests/Feature/Export/ProfitAndLossReportTest.php index 2c81becab..d052b9f09 100644 --- a/tests/Feature/Export/ProfitAndLossReportTest.php +++ b/tests/Feature/Export/ProfitAndLossReportTest.php @@ -144,7 +144,7 @@ class ProfitAndLossReportTest extends TestCase 'balance' => 11, 'status_id' => 2, 'total_taxes' => 1, - 'date' => '2022-01-01', + 'date' => now()->format('Y-m-d'), 'terms' => 'nada', 'discount' => 0, 'tax_rate1' => 0, @@ -183,7 +183,7 @@ class ProfitAndLossReportTest extends TestCase 'balance' => 10, 'status_id' => 2, 'total_taxes' => 1, - 'date' => '2022-01-01', + 'date' => now()->format('Y-m-d'), 'terms' => 'nada', 'discount' => 0, 'tax_rate1' => 10, @@ -226,7 +226,7 @@ class ProfitAndLossReportTest extends TestCase 'balance' => 10, 'status_id' => 2, 'total_taxes' => 1, - 'date' => '2022-01-01', + 'date' => now()->format('Y-m-d'), 'terms' => 'nada', 'discount' => 0, 'tax_rate1' => 10, @@ -282,7 +282,7 @@ class ProfitAndLossReportTest extends TestCase 'balance' => 10, 'status_id' => 2, 'total_taxes' => 0, - 'date' => '2022-01-01', + 'date' => now()->format('Y-m-d'), 'terms' => 'nada', 'discount' => 0, 'tax_rate1' => 0, @@ -313,7 +313,7 @@ class ProfitAndLossReportTest extends TestCase 'amount' => 10, 'company_id' => $this->company->id, 'user_id' => $this->user->id, - 'date' => '2022-01-01', + 'date' => now()->format('Y-m-d'), ]); $pl = new ProfitLoss($this->company, $this->payload); @@ -334,7 +334,7 @@ class ProfitAndLossReportTest extends TestCase $e = ExpenseFactory::create($this->company->id, $this->user->id); $e->amount = 10; - $e->date = '2022-01-01'; + $e->date = now()->format('Y-m-d'); $e->calculate_tax_by_amount = true; $e->tax_amount1 = 10; $e->save(); @@ -358,7 +358,7 @@ class ProfitAndLossReportTest extends TestCase $e = ExpenseFactory::create($this->company->id, $this->user->id); $e->amount = 10; - $e->date = '2022-01-01'; + $e->date = now()->format('Y-m-d'); $e->tax_rate1 = 10; $e->tax_name1 = 'GST'; $e->uses_inclusive_taxes = false; @@ -383,7 +383,7 @@ class ProfitAndLossReportTest extends TestCase $e = ExpenseFactory::create($this->company->id, $this->user->id); $e->amount = 10; - $e->date = '2022-01-01'; + $e->date = now()->format('Y-m-d'); $e->tax_rate1 = 10; $e->tax_name1 = 'GST'; $e->uses_inclusive_taxes = false; @@ -410,7 +410,7 @@ class ProfitAndLossReportTest extends TestCase 'amount' => 10, 'company_id' => $this->company->id, 'user_id' => $this->user->id, - 'date' => '2022-01-01', + 'date' => now()->format('Y-m-d'), 'exchange_rate' => 1, 'currency_id' => $this->company->settings->currency_id, ]); @@ -440,7 +440,7 @@ class ProfitAndLossReportTest extends TestCase 'amount' => 10, 'company_id' => $this->company->id, 'user_id' => $this->user->id, - 'date' => '2022-01-01', + 'date' => now()->format('Y-m-d'), 'exchange_rate' => 1, 'currency_id' => $this->company->settings->currency_id, ]); @@ -454,7 +454,7 @@ class ProfitAndLossReportTest extends TestCase 'amount' => 10, 'company_id' => $this->company->id, 'user_id' => $this->user->id, - 'date' => '2022-01-01', + 'date' => now()->format('Y-m-d'), 'exchange_rate' => 1, 'currency_id' => $this->company->settings->currency_id, ]); @@ -489,7 +489,7 @@ class ProfitAndLossReportTest extends TestCase 'balance' => 10, 'status_id' => 2, 'total_taxes' => 1, - 'date' => '2022-01-01', + 'date' => now()->format('Y-m-d'), 'terms' => 'nada', 'discount' => 0, 'tax_rate1' => 10, @@ -510,7 +510,7 @@ class ProfitAndLossReportTest extends TestCase 'amount' => 10, 'company_id' => $this->company->id, 'user_id' => $this->user->id, - 'date' => '2022-01-01', + 'date' => now()->format('Y-m-d'), 'exchange_rate' => 1, 'currency_id' => $this->company->settings->currency_id, ]); @@ -524,7 +524,7 @@ class ProfitAndLossReportTest extends TestCase 'amount' => 10, 'company_id' => $this->company->id, 'user_id' => $this->user->id, - 'date' => '2022-01-01', + 'date' => now()->format('Y-m-d'), 'exchange_rate' => 1, 'currency_id' => $this->company->settings->currency_id, ]); diff --git a/tests/Unit/GeneratesConvertedQuoteCounterTest.php b/tests/Unit/GeneratesConvertedQuoteCounterTest.php index 5c6e701b3..f0d9e53cc 100644 --- a/tests/Unit/GeneratesConvertedQuoteCounterTest.php +++ b/tests/Unit/GeneratesConvertedQuoteCounterTest.php @@ -115,8 +115,8 @@ class GeneratesConvertedQuoteCounterTest extends TestCase $this->assertNotNull($invoice); - $this->assertEquals('2022-Q0001', $quote->number); - $this->assertEquals('2022-I0001', $invoice->number); + $this->assertEquals(now()->format('Y'). '-Q0001', $quote->number); + $this->assertEquals(now()->format('Y'). '-I0001', $invoice->number); $settings = $this->client->getMergedSettings(); $settings->invoice_number_counter = 100;