Skip to content

Commit

Permalink
add asset injection tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleuverink committed Aug 15, 2024
1 parent ba8cef4 commit b34f466
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/Feature/InjectsAssetsTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

it('injects assets into head tag', function () {
Route::get('test-inject-in-response', fn () => '<html><head></head></html>');

$this->get('test-inject-in-response')
->assertOk()
->assertSee('<!--[DOTOO-ASSETS]-->', false);
});

it('injects assets into html body when no head tag is present', function () {
Route::get('test-inject-in-response', fn () => '<html></html>');

$this->get('test-inject-in-response')
->assertOk()
->assertSee('<!--[DOTOO-ASSETS]-->', false);
});

it('doesnt inject assets into responses without a closing html tag', function () {
Route::get('test-inject-in-response', fn () => 'OK');

$this->get('test-inject-in-response')
->assertOk()
->assertDontSee('<!--[DOTOO-ASSETS]-->', false);
});

0 comments on commit b34f466

Please sign in to comment.