Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Nov 7, 2024
1 parent 1b9160a commit 8024371
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.ci
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ APP_DEBUG=true
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=rezultatevot
DB_DATABASE=tests
DB_USERNAME=root
DB_PASSWORD=tests

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: rezultatevot
MYSQL_DATABASE: tests
MYSQL_ALLOW_EMPTY_PASSWORD: true
ports:
- 3306
Expand Down
1 change: 1 addition & 0 deletions database/factories/ElectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function definition(): array
->loser(fn () => null),
'year' => $year,
'is_live' => false,
'properties' => [],
];
}

Expand Down
6 changes: 5 additions & 1 deletion tests/Feature/Livewire/Pages/ElectionTurnoutsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Tests\Feature\Livewire\Pages;

use App\Livewire\Pages\ElectionTurnouts;
use App\Models\Election;
use Livewire\Livewire;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;
Expand All @@ -14,7 +15,10 @@ class ElectionTurnoutsTest extends TestCase
#[Test]
public function renders_successfully()
{
$election = Election::factory()
->create();

Livewire::test(ElectionTurnouts::class)
->assertStatus(200);
->assertOk();
}
}
3 changes: 2 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

namespace Tests;

use Illuminate\Foundation\Testing\LazilyRefreshDatabase;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
{
//
use LazilyRefreshDatabase;
}

0 comments on commit 8024371

Please sign in to comment.