envelope(); // THEN expect($envelope->subject)->toBe('[Arcadia Security] Client Secret Generated for arcadia_id_testclient'); }); it('builds email content with correct markdown view and typed details', function (): void { // GIVEN $clientId = Uuid::fromString('01917b2f-7f41-7654-8c88-66280be01234'); $details = SecurityAlertDetails::forStatusToggled(false); $occuredAt = new \DateTimeImmutable('2026-08-21 10:00:00 UTC'); $mail = new ClientSecurityAlertMail( eventType: 'Client Status Changed (Deactivated)', clientId: $clientId, clientIdentifier: 'arcadia_id_testclient', occurredAt: $occuredAt, details: $details, ); // WHEN $content = $mail->content(); // THEN expect($content->markdown)->toBe('mails.security-alert') ->and($content->with['eventType'])->toBe('Client Status Changed (Deactivated)') ->and($content->with['clientIdentifier'])->toBe('arcadia_id_testclient') ->and($content->with['clientId'])->toBe($clientId) ->and($content->with['occurredAt'])->toBe($occuredAt) ->and($content->with['details'])->toBe($details) ->and($content->with['details']->isActive)->toBeFalse() ->and($content->with['details']->description)->toBe('Client account suspended'); }); });