Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Jun 26, 2024
1 parent a2a8922 commit 27443ef
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
"require": {
"php": "^8.2",
"illuminate/contracts": "^10.0||^11.0",
"spatie/error-solutions": "dev-main",
"spatie/laravel-package-tools": "^1.16"
"spatie/error-solutions": "^1.0.2",
"spatie/laravel-package-tools": "^1.16",
"spatie/pest-plugin-snapshots": "^2.1"
},
"require-dev": {
"laravel/pint": "^1.14",
Expand Down
7 changes: 7 additions & 0 deletions tests/LaravelComponentCheckTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

use function Spatie\Snapshots\assertMatchesFileSnapshot;

it('still is the same laravel navigation blade component', function () {
assertMatchesFileSnapshot(__DIR__.'/../vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/header.blade.php');
})->skipOnWindows();
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<x-laravel-exceptions-renderer::card>
<div class="md:flex md:items-center md:justify-between md:gap-2">
<div>
<div class="inline-block rounded-full bg-red-500/20 px-3 py-2 dark:bg-red-500/20">
<span class="hidden text-sm font-bold leading-5 text-red-500 md:inline-block lg:text-base">
{{ $exception->class() }}
</span>
<span class="text-sm font-bold leading-5 text-red-500 md:hidden lg:text-base">
{{ implode(' ', array_slice(explode('\\', $exception->class()), -1)) }}
</span>
</div>
<div class="mt-4 text-lg font-semibold text-gray-900 dark:text-white lg:text-2xl">{{ $exception->message() }}</div>
</div>
<div class="hidden text-right md:block md:min-w-64">
<div>
<span class="rounded-full bg-gray-200 px-3 py-2 text-sm leading-5 text-gray-900 dark:bg-gray-800 dark:text-white">
{{ $exception->request()->method() }} {{ $exception->request()->httpHost() }}
</span>
</div>
<div class="mt-4 px-4">
<span class="text-sm text-gray-500 dark:text-gray-400">PHP {{ PHP_VERSION }} — Laravel {{ app()->version() }}</span>
</div>
</div>
</div>
</x-laravel-exceptions-renderer::card>

0 comments on commit 27443ef

Please sign in to comment.