fix: make browser visual CI deterministic for media

Mount host public storage into FrankenPHP so seeded fixtures are served,
and replace PNG-as-JPG fixtures with real JPEGs so Chromium can render them.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-29 08:48:31 -03:00
parent 27f3cee855
commit 2405160046
7 changed files with 28 additions and 0 deletions

View File

@@ -189,6 +189,7 @@ jobs:
-e CACHE_STORE=database \ -e CACHE_STORE=database \
-e QUEUE_CONNECTION=database \ -e QUEUE_CONNECTION=database \
--add-host=host.docker.internal:host-gateway \ --add-host=host.docker.internal:host-gateway \
-v "${GITHUB_WORKSPACE}/storage/app/public:/app/storage/app/public" \
-p 8000:8000 \ -p 8000:8000 \
amare-app:ci amare-app:ci

View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
it('ships visual content fixtures as valid jpeg images', function (): void {
$fixtures = [
'og-default.jpg',
'portfolio-cover.jpg',
'service-cover.jpg',
'gallery.jpg',
'testimonial.jpg',
];
foreach ($fixtures as $fixture) {
$path = dirname(__DIR__).'/fixtures/images/'.$fixture;
expect(is_file($path))->toBeTrue("Missing fixture: {$fixture}");
$info = getimagesize($path);
expect($info)->not->toBeFalse("Unreadable fixture: {$fixture}")
->and($info[0] ?? null)->toBeGreaterThan(0)
->and($info[1] ?? null)->toBeGreaterThan(0)
->and($info[2] ?? null)->toBe(IMAGETYPE_JPEG)
->and($info['mime'] ?? null)->toBe('image/jpeg');
}
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 310 B