-
Notifications
You must be signed in to change notification settings - Fork 264
Open
Labels
SSRhttps://inertiajs.com/server-side-renderinghttps://inertiajs.com/server-side-renderingenhancementNew feature or requestNew feature or request
Description
Now that SSR is possible with Inertia.js, it opens up some really interesting possibilities when it comes to testing an Inertia app. It now seems possible to have the tests actually generate the page HTML. This would allow us to check for any errors when rendering the page, and also run HTML ("see") assertions against the rendered HTML.
I'm creating this issue as a reminder to test this out when I have time. π
Possible new config:
<?php
return [
'ssr_mode' => env('INERTIA_SSR_MODE', false), // false, 'node', 'server', 'lambda'
];Something to explore: Automatically removing the data-page attribute in testing mode, so that when you run an HTML assertion, it doesnβt match against the JSON encoded page object, but has to match against the actual rendered HTML. For example:
public function test_can_view_organizations()
{
$this->actingAs($this->user)
->get('/organizations')
->assertSee('Apple')
->assertSee('Microsoft')
->assertDontSee('Yahoo');
}AlexanderFalkenberg, xhava, Slund, matthiasweiss and olivervogeloberocksryancco and jonnywilliamson
Metadata
Metadata
Assignees
Labels
SSRhttps://inertiajs.com/server-side-renderinghttps://inertiajs.com/server-side-renderingenhancementNew feature or requestNew feature or request
Type
Projects
Status
New π