Skip to content

Commit

Permalink
chore: update to use Pest built-in snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
owenvoke committed Aug 25, 2023
1 parent cd4321e commit bf921e5
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"orchestra/testbench": "^8.5",
"pestphp/pest": "^2.16",
"phpstan/phpstan": "^1.10",
"spatie/pest-plugin-snapshots": "^2.0",
"symfony/var-dumper": "^6.3",
"thecodingmachine/phpstan-safe-rule": "^1.2"
},
Expand Down
8 changes: 3 additions & 5 deletions tests/CompilesIconsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,22 @@

use OwenVoke\BladeEntypo\Tests\TestCase;

use function Spatie\Snapshots\assertMatchesSnapshot;

uses(TestCase::class);

it('compiles a single anonymous component', function () {
$result = svg('entypo-plus')->toHtml();

assertMatchesSnapshot($result);
expect($result)->toMatchSnapshot();
});

it('can add classes to icons', function () {
$result = svg('entypo-plus', 'w-6 h-6 text-gray-500')->toHtml();

assertMatchesSnapshot($result);
expect($result)->toMatchSnapshot();
});

it('can add styles to icons', function () {
$result = svg('entypo-plus', ['style' => 'color: #555'])->toHtml();

assertMatchesSnapshot($result);
expect($result)->toMatchSnapshot();
});

0 comments on commit bf921e5

Please sign in to comment.