'Mirfalah Sdn Bhd', 'legal.registration' => '202601234567', 'legal.email' => 'privacy@example.com', ]); $this->get(route('privacy')) ->assertOk() ->assertInertia(fn (Assert $page) => $page ->component('legal/privacy') ->where('operator', 'Mirfalah Sdn Bhd') ->where('registration', '202601234567') ->where('email', 'privacy@example.com') ->where('updated', '22 November 2026') ->has('aiCompanies')); } public function test_visitors_can_read_the_terms() { $this->get(route('terms')) ->assertOk() ->assertInertia(fn (Assert $page) => $page ->component('legal/terms') ->where('trialDays', 14)); } public function test_the_pages_name_the_ai_companies_the_tasks_use_now() { config([ 'ai.tasks.generate.provider' => 'claude', 'ai.tasks.edit.provider' => 'deepseek', ]); $this->assertSame([ ['name' => 'Anthropic', 'country' => 'the United States'], ['name' => 'DeepSeek', 'country' => 'China'], ], LegalController::aiCompanies()); // After switching every task to one provider, only that company is named. config(['ai.tasks.edit.provider' => 'claude']); $this->assertSame([ ['name' => 'Anthropic', 'country' => 'the United States'], ], LegalController::aiCompanies()); } public function test_every_real_ai_provider_has_a_company_for_the_legal_pages() { $providers = array_diff(array_keys(config('ai.providers')), ['fake']); foreach ($providers as $provider) { $this->assertNotNull( config("legal.ai_companies.{$provider}"), "Add the company behind the \"{$provider}\" AI provider to config/legal.php, so the privacy policy names it.", ); } } public function test_the_sign_up_page_works_with_its_links_to_the_terms() { $this->get(route('register'))->assertOk(); } }