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>
1
.github/workflows/ci.yml
vendored
@@ -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
|
||||||
|
|
||||||
|
|||||||
27
tests/Unit/VisualFixturesTest.php
Normal 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');
|
||||||
|
}
|
||||||
|
});
|
||||||
BIN
tests/fixtures/images/gallery.jpg
vendored
|
Before Width: | Height: | Size: 70 B After Width: | Height: | Size: 310 B |
BIN
tests/fixtures/images/og-default.jpg
vendored
|
Before Width: | Height: | Size: 70 B After Width: | Height: | Size: 310 B |
BIN
tests/fixtures/images/portfolio-cover.jpg
vendored
|
Before Width: | Height: | Size: 70 B After Width: | Height: | Size: 310 B |
BIN
tests/fixtures/images/service-cover.jpg
vendored
|
Before Width: | Height: | Size: 70 B After Width: | Height: | Size: 311 B |
BIN
tests/fixtures/images/testimonial.jpg
vendored
|
Before Width: | Height: | Size: 70 B After Width: | Height: | Size: 310 B |