Skip to content

Commit

Permalink
Add version badge to readme, clean up some tests and add some simple …
Browse files Browse the repository at this point in the history
…ones
  • Loading branch information
xam-ps committed Dec 29, 2024
1 parent 0498bd6 commit 81322da
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 12 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This was coded part time in a week while working a full time job. There is still
# LASO

[![Tests](https://github.com/xam-ps/LASO/actions/workflows/tests.yml/badge.svg)](https://github.com/xam-ps/LASO/actions/workflows/tests.yml)
[![GitHub Release](https://img.shields.io/github/v/release/xam-ps/LASO)](https://github.com/xam-ps/LASO/releases/latest)
[![Xampit](https://img.shields.io/badge/powered_by-Xampit-2487b8.svg)](https://xampit.de/)

Laravel annual statement online (a small online tool to do the annual statement in Germany for one person companies)
Expand Down
3 changes: 0 additions & 3 deletions tests/Feature/AssetsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

class AssetsTest extends TestCase
{
/**
* A basic feature test example.
*/
public function test_asset_page_shows_assets(): void
{
$user = User::factory()->create();
Expand Down
3 changes: 0 additions & 3 deletions tests/Feature/DashboardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@

class DashboardTest extends TestCase
{
/**
* A basic test example.
*/
public function test_a_guest_user_should_get_redirected_to_login(): void
{
$response = $this->get('/');
Expand Down
62 changes: 62 additions & 0 deletions tests/Feature/ExpenseTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

namespace Tests\Feature;

use App\Models\User;
use Database\Seeders\CostTypeSeeder;
use Tests\TestCase;

class ExpenseTest extends TestCase
{
public function test_create_expense_page_is_loaded(): void
{
$user = User::factory()->createOne();

$expensePage = $this->actingAs($user)
->get('/expense/create');

$expensePage->assertSeeInOrder([
'Rechnungsdatum',
'Zahlungseingang',
'Lieferant',
'Produkt',
'Rechnungsnummer',
'Netto',
'Steuer',
'Brutto',
'Typ',
]);
$expensePage->assertStatus(200);
}

//Create a test, that fills in the create expense form, submits it and checks, if the values are stored in the database.
public function test_create_expense(): void
{
$user = User::factory()->createOne();

$expense = [
'billing_date' => '2021-01-01',
'payment_date' => '2021-01-02',
'supplier_name' => 'Supplier',
'product_name' => 'Product',
'invoice_number' => '123',
'net' => 100.00,
'tax' => 19.00,
'gross' => 119.00,
'cost_type' => 4,
];

$this->actingAs($user)
->post('expense/', $expense);

$this->assertDatabaseHas('expenses', $expense);
}

protected function setUp(): void
{
parent::setUp();

$this->withoutMiddleware(\App\Http\Middleware\VerifyCsrfToken::class);
$this->seed(CostTypeSeeder::class);
}
}
28 changes: 28 additions & 0 deletions tests/Feature/RevenueTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Tests\Feature;

use App\Models\User;
use Tests\TestCase;

class RevenueTest extends TestCase
{
public function test_create_revenue_page_is_loaded(): void
{
$user = User::factory()->create();

$revenuePage = $this->actingAs($user)
->get('/revenue/create');

$revenuePage->assertSeeInOrder([
'Rechnungsdatum',
'Zahlungseingang',
'Kunde',
'Rechnungsnummer',
'Netto',
'Steuer',
'Brutto',
]);
$revenuePage->assertStatus(200);
}
}
3 changes: 0 additions & 3 deletions tests/Feature/StatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

class StatementTest extends TestCase
{
/**
* A basic feature test example.
*/
public function test_statement_page_is_loaded(): void
{
$user = User::factory()->create();
Expand Down
14 changes: 11 additions & 3 deletions tests/Feature/TravelAllowanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

class TravelAllowanceTest extends TestCase
{
/**
* A basic feature test example.
*/
public function test_travel_allowance_page(): void
{
$user = User::factory()->createOne();
Expand Down Expand Up @@ -42,4 +39,15 @@ public function test_travel_allowance_sum_is_correct(): void
$travel1->delete();
$travel2->delete();
}

public function test_create_travel_allowance_page(): void
{
$user = User::factory()->createOne();

$createTravelAllowancePage = $this->actingAs($user)
->get('/travel-allowance/create');

$createTravelAllowancePage->assertSee('Neue Fahrt anlegen');
$createTravelAllowancePage->assertStatus(200);
}
}
13 changes: 13 additions & 0 deletions tests/Feature/VatNoticeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,17 @@ public function test_vat_notice_page_shows_notices(): void

$vatNotice->delete();
}

public function test_create_vat_notice_page_is_loaded(): void
{
$user = User::factory()->create();

$vatNoticePage = $this->actingAs($user)
->get('/vat-notice/create');

$vatNoticePage->assertSeeInOrder([
'Meldedatum',
]);
$vatNoticePage->assertStatus(200);
}
}

0 comments on commit 81322da

Please sign in to comment.