-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests #89
Comments
Since we just converted this to Inertia, they'll need to be Inertia tests. Here's a sample from the docs: use Inertia\Testing\Assert;
class PodcastsControllerTest extends TestCase
{
public function test_can_view_podcast()
{
$this->get('/podcasts/41')
->assertInertia(fn (Assert $page) => $page
->component('Podcasts/Show')
->has('podcast', fn (Assert $page) => $page
->where('id', $podcast->id)
->where('subject', 'The Laravel Podcast')
->where('description', 'The Laravel Podcast brings you Laravel and PHP development news and discussion.')
->has('seasons', 4)
->has('seasons.4.episodes', 21)
->has('host', fn (Assert $page) => $page
->where('id', 1)
->where('name', 'Matt Stauffer')
)
->has('subscribers', 7, fn (Assert $page) => $page
->where('id', 2)
->where('name', 'Claudio Dekker')
->where('platform', 'Apple Podcasts')
->etc()
->missing('email')
->missing('password')
)
)
);
}
} They don't have full docs yet but the testing helpers are imported from a package with docs, so we can use the docs from the package for now: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I know I slapped this thing together on a stream really quickly, but now that other folks are using it, I think it's time to treat it like a Real Tighten Package ™ and write some tests and stuff :)
The text was updated successfully, but these errors were encountered: