Do you mean with phpunit? What exactly are you trying to test? That there is a script tag ?
Nov 11, 2022
4
Level 15
How to test @section result in View Component
I have this code in my awesome.blade.php what belongs to AwesomeComponent.php:
@section('scripts')
<script type="text/javascript">
var myCarousel = document.querySelector('#carousel-{{ $banner->id }}')
var carousel = new bootstrap.Carousel(myCarousel)
</script>
@endsection
// here is some other HTML codes
How should I test the result of @section('script') ?
Please or to participate in this conversation.