@@ -8,6 +8,7 @@ use App\Models\InvestmentSubmission;
|
||||
use App\Models\Opportunity;
|
||||
use App\Models\Sector;
|
||||
use App\Models\User;
|
||||
use App\Services\Malware\MalwareScanner;
|
||||
use Database\Seeders\InvestmentReferenceSeeder;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
@@ -15,12 +16,20 @@ use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Inertia\Testing\AssertableInertia as Assert;
|
||||
use Tests\Support\CleanScannerFixture;
|
||||
use Tests\TestCase;
|
||||
|
||||
class InvestmentUnificationTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->app->bind(MalwareScanner::class, fn () => new CleanScannerFixture);
|
||||
$this->withoutVite();
|
||||
}
|
||||
|
||||
private function option(string $group, string $code): int
|
||||
{
|
||||
return DB::table('investment_reference_options')->where('group', $group)->where('code', $code)->value('id');
|
||||
@@ -66,7 +75,8 @@ class InvestmentUnificationTest extends TestCase
|
||||
$this->getJson('/api/v1/investment/submissions/'.$id)->assertHeader('Cache-Control', 'no-store, private');
|
||||
InterestRequest::firstOrFail()->update(['status' => 'in_review']);
|
||||
$this->postJson('/api/v1/investment/submissions/'.$id.'/submit', $this->payload(2))->assertJsonPath('status', 'in_review');
|
||||
$this->get('/balcao-virtual')->assertInertia(fn (Assert $page) => $page->has('requests', 1));
|
||||
$this->get('/balcao-virtual')->assertRedirect('/balcao-virtual/painel');
|
||||
$this->get('/balcao-virtual/painel')->assertInertia(fn (Assert $page) => $page->has('legacyRequests', 1));
|
||||
$this->assertSame(3, DB::table('investment_submission_events')->where('submission_id', $id)->count());
|
||||
$this->putJson('/api/v1/investment/submissions/'.$id, $this->payload(3))->assertConflict();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user