developing-with-turbo-tests

Validate Turbo Streams, Turbo Frames, and Hotwire Native interactions in Laravel feature tests.

840|53|Updated Dec 29, 2020
One-click install
npx skills add https://github.com/hotwired-laravel/turbo-laravel --skill developing-with-turbo-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: developing-with-turbo-tests
Source: https://github.com/hotwired-laravel/turbo-laravel/tree/main/resources/boost/skills/developing-with-turbo-tests
Command: npx skills add https://github.com/hotwired-laravel/turbo-laravel --skill developing-with-turbo-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps Laravel developers validate Turbo-specific behaviors in automated tests.

Core Features & Use Cases

  • Leverage the InteractsWithTurbo trait in tests to simulate Turbo requests and verify responses.
  • Test Turbo Stream responses, Turbo Frame requests, and Hotwire Native interactions in feature tests.
  • Use test macros like assertTurboStream and assertNotTurboStream to ensure correct Turbo behavior.

Quick Start

Set up a Laravel project and enable Turbo Laravel in tests. Create a test that uses the InteractsWithTurbo trait, then simulate Turbo Stream and Turbo Frame interactions to verify UI updates.

Frequently Asked Questions about developing-with-turbo-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test Turbo Stream responses in Laravel feature tests?

Test Turbo Stream responses in Laravel by using the InteractsWithTurbo trait in feature tests and applying the assertTurboStream macro to verify UI updates in the response.

Can I test Turbo Frame requests and Hotwire Native interactions in Laravel?

Yes, you can test Turbo Frame requests and Hotwire Native interactions in Laravel by enabling the InteractsWithTurbo trait to simulate and validate specific Turbo behaviors in feature tests.

What is the best way to assert Turbo behavior in Laravel automated tests?

The best way to assert Turbo behavior in Laravel is using Turbo testing macros like assertTurboStream and assertNotTurboStream within tests utilizing the InteractsWithTurbo trait.

Do I need a specific Laravel testing environment to validate Turbo behaviors?

Yes, validating Turbo behaviors requires the standard Laravel testing environment set up with Turbo Laravel, where you enable the InteractsWithTurbo trait to simulate requests accurately.

How do I verify that a Laravel controller does not return a Turbo Stream?

Verify a Laravel controller does not return a Turbo Stream by using the assertNotTurboStream test macro alongside the InteractsWithTurbo trait in your feature tests.