UPDATED TESTS

This commit is contained in:
Mark Gregory
2026-06-11 12:35:19 +01:00
parent b993881d52
commit 99e4bba178
5 changed files with 57 additions and 11 deletions
+13 -2
View File
@@ -14,6 +14,17 @@ class WarehouseCrudTest extends TestCase
{
use RefreshDatabase;
/**
* Disable only CSRF for controller behaviour tests; auth/tenant/licence middleware still runs.
*/
protected function setUp(): void
{
parent::setUp();
$this->withoutMiddleware(\Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class);
$this->withoutMiddleware(\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class);
}
/**
* Ensure licensed tenant users can see the warehouse dashboard for their company.
*/
@@ -23,9 +34,9 @@ class WarehouseCrudTest extends TestCase
Warehouse::create(['company_id' => $user->company_id, 'code' => 'MAIN', 'name' => 'Main Warehouse']);
$this->actingAs($user)
->get(route('dashboard'))
->get(route('warehouses.index'))
->assertOk()
->assertSee('Test Company', false)
->assertSee('Warehouses', false)
->assertSee('Main Warehouse', false);
}