Criar Hotel: a mudança de sector feita pelo investidor no editor continua directa (C10)
tests / ci (push) Canceled after 0s

O sector escolhido pelo próprio investidor no editor do dossier substitui a
actividade, como aprovado em C10; o que chega de outra referência ou da
página de entrada continua a ser só proposta. Retirar a actividade também
passa a exigir a escolha explícita.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzJmxFy3izprXr5dSq91jM
This commit is contained in:
Claude
2026-12-04 21:11:45 +02:00
committed by nala
parent 7446970c64
commit 2c03a0091e
3 changed files with 26 additions and 5 deletions
@@ -5,6 +5,7 @@ namespace Tests\Feature;
use App\Models\Sector;
use App\Models\User;
use App\Services\InvestmentZones;
use App\Services\InvestorPath;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
@@ -128,11 +129,15 @@ class InvestmentContextContinuityTest extends TestCase
$apply(['sector' => null]);
$this->getJson('/investimentos/'.$id.'/contexto')->assertJsonPath('context.fields.sector_id', (string) $tourism->id);
// The dossier choice shows each dossier's activity.
$listed = collect(app(\App\Services\InvestorPath::class)->contexts($owner))->firstWhere('id', $id);
$listed = collect(app(InvestorPath::class)->contexts($owner))->firstWhere('id', $id);
$this->assertSame([(string) $tourism->id, $tourism->name], [$listed['sector_id'], $listed['sector']]);
$apply(['sector' => 'sector:'.$agro->id], ['sector_id', 'sector']);
$this->getJson('/investimentos/'.$id.'/contexto')->assertJsonPath('context.fields.sector_id', (string) $agro->id)->assertJsonPath('context.fields.sector', $agro->name);
// Removing the activity is also an explicit decision (C10 explicit changes keep working).
$apply(['sector' => null], ['sector_id', 'sector']);
$this->assertArrayNotHasKey('sector_id', $this->getJson('/investimentos/'.$id.'/contexto')->json('context.fields'));
}
public function test_the_business_plan_executive_summary_fields_are_saved_in_the_draft(): void