Skip to content

Commit

Permalink
Add tests for add pack/packs
Browse files Browse the repository at this point in the history
  • Loading branch information
mbardelmeijer committed Sep 2, 2020
1 parent b6b819c commit 0e5dd84
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/PackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,24 @@ public function test_exception_on_non_existing_pack()

app(PackCollection::class)->find('non-existing');
}

public function test_manually_adding_pack()
{
app(PackCollection::class)->addPack('icons', [
'path' => __DIR__ . '/fixtures/icons',
]);

$this->assertNotEmpty(svg('clock')->pack('icons'));
}

public function test_manually_adding_packs()
{
app(PackCollection::class)->addPacks([
'icons' => [
'path' => __DIR__ . '/fixtures/icons',
]
]);

$this->assertNotEmpty(svg('clock')->pack('icons'));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;" id="svg-spritesheet"></svg>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<svg aria-hidden="true" focusable="false" role="img">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#custom-clock"/>
</svg>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;" id="svg-spritesheet"><symbol id="custom-clock" viewBox="0 0 512 512"><path fill="currentColor" d="M256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8Zm92.49,313h0l-20,25a16,16,0,0,1-22.49,2.5h0l-67-49.72a40,40,0,0,1-15-31.23V112a16,16,0,0,1,16-16h32a16,16,0,0,1,16,16V256l58,42.5A16,16,0,0,1,348.49,321Z"></path></symbol></svg>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<svg width="1.125em" class="svg-auto-size mr-4" aria-hidden="true" focusable="false" role="img">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icons-house"/>
</svg>
4 changes: 4 additions & 0 deletions tests/__snapshots__/SvgTest--test_svg_rendering--68--1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<svg aria-hidden="true" focusable="false" role="img">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#custom-clock"/>
</svg>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<svg width="48" height="60" aria-hidden="true" focusable="false" role="img">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#custom-fixed-width-height"/>
</svg>

0 comments on commit 0e5dd84

Please sign in to comment.