diff options
author | Sam Light <sam@lightscale.co.uk> | 2025-03-31 23:49:06 +0100 |
---|---|---|
committer | Sam Light <samlight1994@gmail.com> | 2025-03-31 23:49:06 +0100 |
commit | d26af3da4f2419e868e70b65c61c6f69649f1798 (patch) | |
tree | 13af2529f405b7aab3542dad3a1c7ef190fc9464 | |
parent | 055a384dd3eb8cf1ee0202f2eb25b86d4a3a515f (diff) |
Created test for componentsv0.0.1
-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); +}); |