added complex address and devisions to company

This commit is contained in:
Mark Gregory
2026-07-03 10:12:04 +01:00
parent 6be15611eb
commit 0e067a15f3
25 changed files with 972 additions and 134 deletions
@@ -0,0 +1,36 @@
<?php
namespace Modules\Company\Tests\Browser;
use App\Models\User;
use Laravel\Dusk\Browser;
use Modules\Company\Models\Company;
use Modules\Countries\Models\Country;
use Tests\DuskTestCase;
class CompanyAdministrationBrowserTest extends DuskTestCase
{
public function test_platform_admin_can_see_company_address_divisions_and_director_sections(): void
{
$system = Company::query()->firstOrCreate(['slug' => 'mpba-limited'], ['name' => 'MPBA Limited', 'is_system_company' => true, 'status' => 'active']);
$tenant = Company::query()->firstOrCreate(['slug' => 'sentinel'], ['name' => 'Sentinel', 'status' => 'active']);
Country::query()->firstOrCreate(['alpha2' => 'GB'], ['alpha3' => 'GBR', 'numeric' => '826', 'name' => 'United Kingdom', 'is_active' => true]);
$admin = User::query()->firstOrCreate(['email' => 'company-admin-browser@example.test'], [
'company_id' => $system->id,
'name' => 'Company Browser Admin',
'password' => bcrypt('password'),
'is_platform_admin' => true,
'status' => 'active',
]);
$this->browse(function (Browser $browser) use ($admin, $tenant): void {
$browser->loginAs($admin)
->visitRoute('platform.companies.show', $tenant)
->assertSee('Company address')
->assertSee('Create division')
->assertSee('Director coverage')
->assertSee('Warehouse division and address alignment')
->assertSee('Divisions');
});
}
}