silviolleite / laravel-pwa

Looks like an app, feels like an app, but IS NOT an app.
MIT License
963 stars 154 forks source link

Laravel method assertSeeText() failing because of JavaScript comment #6

Closed fterrani closed 5 years ago

fterrani commented 5 years ago

The Laravel method TestResponse::assertSeeText() fails when turning on laravel-pwa.

It is because this method uses strip_tags() to remove HTML tags before checking if a given text is found in the page.

The bug is simply caused by a this JavaScript comment in views/modules/laravelpwa/meta.blade.php:

// <--- THIS BIT IS REQUIRED

Strangely, <-- apparently confuses strip_tags(). Like this:

$str = "aaa bbb <-- ccc ddd";
echo strip_tags( $str ); // Displays "aaa bbb " (tested in a PHP 7.2.4 sandbox)
silviolleite commented 5 years ago

Hello @fterrani I have fixed it on new release 1.0.4. https://github.com/silviolleite/laravel-pwa/releases/tag/1.0.4. Can you update and try it again.

fterrani commented 5 years ago

Hello @silviolleite ,

Looks like it's working for me. Thanks for the fix :)