diff options
Diffstat (limited to 'tests/Feature/ComponentsTest.php')
| -rw-r--r-- | tests/Feature/ComponentsTest.php | 32 | 
1 files changed, 32 insertions, 0 deletions
| diff --git a/tests/Feature/ComponentsTest.php b/tests/Feature/ComponentsTest.php new file mode 100644 index 0000000..d2ba126 --- /dev/null +++ b/tests/Feature/ComponentsTest.php @@ -0,0 +1,32 @@ +<?php + +use Lightscale\LaralightAssets\Facades\Assets; + +beforeEach(function() { +    Assets::registerManifest( +        'main', public_path('dist/manifest.json'), '/dist' +    ); + +    Assets::queueScript('main::main.js'); +    Assets::queueStyle('main::main.css'); +}); + +it('render head', function() { +    $view = $this->blade( +        '<x-laralight-assets::head />' +    ); +    $view->assertSee(sprintf( +        '<link type="text/css" rel="stylesheet" href="%s" />', +        asset('dist/main.testing.css') +    ), false); +}); + +it('render footer', function() { +    $view = $this->blade( +        '<x-laralight-assets::footer />' +    ); +    $view->assertSee(sprintf( +        '<script src="%s"></script>', +        asset('dist/main.testing.js') +    ), false); +}); | 
