From 138ff4bea020350f6b067624dea328d88ceb74b0 Mon Sep 17 00:00:00 2001 From: Sam Light Date: Mon, 31 Mar 2025 23:28:21 +0100 Subject: Queuing files --- tests/Feature/AssetsTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/Feature') diff --git a/tests/Feature/AssetsTest.php b/tests/Feature/AssetsTest.php index f618d46..9614eee 100644 --- a/tests/Feature/AssetsTest.php +++ b/tests/Feature/AssetsTest.php @@ -94,5 +94,24 @@ describe('manages manifests', function() use ($newManifest) { $result = $assets->getFileManifest($file); expect($result)->toBe($manifest); }); +}); + +describe('queuing files', function() use ($newManifest) { + test('queue script', function() use ($newManifest) { + $assets = app(Assets::class); + $manifest = $newManifest(); + $assets->addManifest('main', $manifest, true); + $assets->queueScript('main::main.js'); + + expect($assets->getQueuedFooterFiles())->toBeArray()->toHaveLength(1); + }); + + test('queue style', function() use ($newManifest) { + $assets = app(Assets::class); + $manifest = $newManifest(); + $assets->addManifest('main', $manifest, true); + $assets->queueStyle('main::main.css'); + expect($assets->getQueuedHeadFiles())->toBeArray()->toHaveLength(1); + }); }); -- cgit v1.2.3