fixed tests

This commit is contained in:
Mark Gregory
2026-06-19 11:25:50 +01:00
parent 6d97a98c02
commit 030b1f5eb0
8 changed files with 328 additions and 312 deletions
+2 -13
View File
@@ -2,26 +2,15 @@
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class ExampleTest extends TestCase
{
use RefreshDatabase;
/**
* Ensure the public home route renders successfully.
*/
public function test_home_route_returns_successful_response(): void
public function test_home_route_redirects_guests_to_login(): void
{
$this->get(route('home'))
->assertOk()
->assertSee('Laravel', false);
$this->get(route('home'))->assertRedirect(route('login'));
}
/**
* Ensure the health endpoint is available for deployment checks.
*/
public function test_health_endpoint_returns_successful_response(): void
{
$this->get('/up')->assertOk();
@@ -5,6 +5,7 @@ namespace Tests\Feature\Modules;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Route;
use Modules\Platform\app\Models\PlatformPrice;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
@@ -49,6 +50,22 @@ class NavigatorHeaderCoverageTest extends TestCase
{
$user = User::factory()->mpbaPlatformAdmin()->create();
PlatformPrice::query()->updateOrCreate(
['code' => 'basic'],
[
'name' => 'Basic',
'strapline' => 'Starter WMS platform access.',
'description' => 'Core warehouse management tools.',
'monthly_amount' => 4900,
'annual_amount' => 49000,
'currency' => 'gbp',
'features' => ['2 warehouses', '10 users', 'Standard support'],
'sort_order' => 10,
'is_active' => true,
'is_featured' => false,
],
);
$this->actingAs($user)
->get(route('platform.dashboard'))
->assertOk()