whisper-money/tests/Feature/PwaTest.php

22 lines
721 B
PHP

<?php
test('service worker exists', function () {
expect(file_exists(public_path('sw.js')))->toBeTrue();
});
test('web manifest starts at dashboard with standalone display', function () {
$manifest = json_decode(file_get_contents(public_path('favicon/site.webmanifest')), true);
expect($manifest['start_url'])->toBe('/dashboard')
->and($manifest['display'])->toBe('standalone');
});
test('app template includes pwa meta tags and service worker registration', function () {
$response = $this->get('/');
$response->assertStatus(200)
->assertSee('apple-mobile-web-app-capable', false)
->assertSee('serviceWorker', false)
->assertSee('viewport-fit=cover', false);
});