Files
ladill-frontdesk/tests/Unit/WatchlistServiceTest.php
isaaccladandCursor 9e2d79936c
Deploy Ladill Frontdesk / deploy (push) Failing after 35s
Test / test (push) Failing after 2m45s
Initial Ladill Frontdesk release with deploy pipeline.
Visitor management app with SSO, kiosk, badges, reports, and Gitea CI deploy to frontdesk.ladill.com.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 20:37:15 +00:00

41 lines
1.2 KiB
PHP

<?php
namespace Tests\Unit;
use App\Models\Organization;
use App\Models\Visitor;
use App\Services\Frontdesk\WatchlistService;
use PHPUnit\Framework\Attributes\Test;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Tests\TestCase;
class WatchlistServiceTest extends TestCase
{
#[Test]
public function blacklisted_visitor_is_blocked(): void
{
$visitor = new Visitor(['watchlist_status' => Visitor::WATCHLIST_BLACKLISTED]);
$this->expectException(HttpException::class);
app(WatchlistService::class)->assertCanCheckIn($visitor);
}
#[Test]
public function allowed_visitor_passes_watchlist_check(): void
{
$visitor = new Visitor(['watchlist_status' => Visitor::WATCHLIST_ALLOWED]);
app(WatchlistService::class)->assertCanCheckIn($visitor);
$this->assertTrue(true);
}
#[Test]
public function requires_approval_visitor_is_not_blocked_at_gate(): void
{
$visitor = new Visitor(['watchlist_status' => Visitor::WATCHLIST_REQUIRES_APPROVAL]);
app(WatchlistService::class)->assertCanCheckIn($visitor);
$this->assertTrue(app(WatchlistService::class)->visitorNeedsApprovalQueue($visitor));
}
}