V2.1: Tester-Szenarien Portalbestätigung, Nachricht über anderes Medium, allgemeine Frage
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8026eceab4
commit
f8561fe0e5
6 files changed
+235
-2
No files matched your search
@@ -6,6 +6,7 @@
|
||||
use App\Filament\Resources\Channels\Pages\ChannelProcess;
|
||||
use App\Filament\Resources\Channels\Pages\ChannelProcessTest;
|
||||
use App\Models\Booking;
|
||||
use App\Models\BookingTask;
|
||||
use App\Models\Channel;
|
||||
use App\Models\ProcessTestRun;
|
||||
use App\Models\Property;
|
||||
@@ -132,6 +133,39 @@ public function test_a_portal_booking_scenario_with_cancellation_report(): void
|
||||
$this->assertFalse((bool) $fewo->fresh()->is_active, 'the real channel is unchanged');
|
||||
}
|
||||
|
||||
/** V2.1: waiting for the portal's confirmation – shows the wait, the protected occupation and the escalation in the tester */
|
||||
public function test_the_portal_confirmation_scenarios_show_waiting_arrival_and_escalation(): void
|
||||
{
|
||||
$portal = Channel::factory()->for($this->property)->create(['name' => 'Destination Solution', 'booking_model' => 'portal_booking', 'status' => 'setup', 'is_active' => false, 'import_enabled' => false, 'settings' => ['import_url' => 'https://ds.example/a.ics', 'email_senders' => 'ds.example']]);
|
||||
$draft = ['model' => 'a3.portal_booking', 'settings' => ['await_portal_confirmation' => '1', 'booking_notice' => 'automatic']];
|
||||
|
||||
$late = app(ProcessSandbox::class)->run($portal, IntakeKind::Booking, $draft, 'portal_confirmation_wait', ['arrival' => '2026-11-14', 'nights' => 4, 'guests' => 2, 'confirmation' => 'late'], 6, $this->user)->report;
|
||||
$missing = app(ProcessSandbox::class)->run($portal, IntakeKind::Booking, $draft, 'portal_confirmation_wait', ['arrival' => '2026-11-14', 'nights' => 4, 'guests' => 2, 'confirmation' => 'missing'], 6, $this->user)->report;
|
||||
|
||||
$this->assertNull($late['aborted'] ?? null, json_encode($late));
|
||||
$known = $late['timeline'][0];
|
||||
$this->assertStringContainsString('wartet', json_encode($known['activities'], JSON_UNESCAPED_UNICODE));
|
||||
$this->assertSame([], $known['mails'], 'nothing goes out while the confirmation is missing');
|
||||
$this->assertNotEmpty(end($late['timeline'])['mails'], 'after the confirmation the booking information goes out (sandbox only)');
|
||||
$this->assertStringContainsString('ausgeblieben', json_encode(end($missing['timeline'])['activities'], JSON_UNESCAPED_UNICODE));
|
||||
$this->assertSame(0, Booking::query()->count());
|
||||
$this->assertSame(0, BookingTask::query()->count(), 'the escalation task exists only inside the sandbox');
|
||||
}
|
||||
|
||||
/** V2.1 E/F: other media and questions without a case, through the isolated tester */
|
||||
public function test_the_message_scenarios_show_assignment_and_never_create_a_case(): void
|
||||
{
|
||||
config(['communication.media.chat.active' => true, 'communication.media.whatsapp.active' => true]);
|
||||
$website = Channel::websiteOf($this->property);
|
||||
|
||||
$question = app(ProcessSandbox::class)->run($website, IntakeKind::Inquiry, ['model' => 'a1.offer'], 'general_question_message', ['text' => 'question'], 1, $this->user)->report;
|
||||
$reply = app(ProcessSandbox::class)->run($website, IntakeKind::Inquiry, ['model' => 'a1.offer'], 'message_other_medium', ['arrival' => '2026-11-07', 'nights' => 3, 'guests' => 2, 'medium' => 'whatsapp', 'reference' => 'none', 'consent' => true], 2, $this->user)->report;
|
||||
|
||||
$this->assertNull($question['aborted'] ?? null, json_encode($question));
|
||||
$this->assertNull($reply['aborted'] ?? null, json_encode($reply));
|
||||
$this->assertSame(0, Booking::query()->count());
|
||||
}
|
||||
|
||||
/** S12/T06: a failing mail server leaves the case in a defined state */
|
||||
public function test_a_mail_failure_keeps_the_case(): void
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user