Add PWA scanner app for organizers at /scanner
Standalone installable PWA with: - JWT login via /api/auth/login - Event list from /api/live/events - QR code camera scanning (html5-qrcode library) - Scan results with accepted/refused state and ticket details - Auto token refresh on expiry - Offline caching via service worker - Dark theme optimized for outdoor scanning - Vibration feedback on scan Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
40
tests/Controller/ScannerControllerTest.php
Normal file
40
tests/Controller/ScannerControllerTest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Tests\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
class ScannerControllerTest extends WebTestCase
|
||||
{
|
||||
public function testScannerPageReturnsSuccess(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
$client->request('GET', '/scanner');
|
||||
|
||||
self::assertResponseIsSuccessful();
|
||||
self::assertSelectorTextContains('title', 'E-Ticket Scanner');
|
||||
}
|
||||
|
||||
public function testScannerManifestReturnsJson(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
$client->request('GET', '/scanner/manifest.json');
|
||||
|
||||
self::assertResponseIsSuccessful();
|
||||
self::assertResponseHeaderSame('Content-Type', 'application/manifest+json');
|
||||
|
||||
$data = json_decode($client->getResponse()->getContent(), true);
|
||||
self::assertSame('E-Ticket Scanner', $data['name']);
|
||||
self::assertSame('standalone', $data['display']);
|
||||
self::assertSame('/scanner', $data['start_url']);
|
||||
}
|
||||
|
||||
public function testScannerPageIsAccessibleWithoutAuth(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
$client->request('GET', '/scanner');
|
||||
|
||||
self::assertResponseIsSuccessful();
|
||||
self::assertResponseStatusCodeSame(200);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user