I added the method requestProp (name open for discussion 😉) to the AssertableInertia class which let you easy test LazyProps.
/** @test */
public function test_props(): void
{
$this
->get('/')
->assertInertia(function (AssertableInertia $page) {
$page->has('normalPropKey');
$page->missing('lazyPropKey');
$page->requestProp('lazyPropKey', function (AssertableInertia $page) {
$page->where('lazyPropKey', '1');
});
});
}
The method uses the previous request, applies the X-Inertia-Partial-Component and X-Inertia-Partial-Data headers, which are automatically seeded and resends it. A convenient way for the tester, and they do not need to know the internal mechanics of Intertia. Which I found in #604.
I added the method
requestProp
(name open for discussion 😉) to the AssertableInertia class which let you easy test LazyProps.The method uses the previous request, applies the
X-Inertia-Partial-Component
andX-Inertia-Partial-Data
headers, which are automatically seeded and resends it. A convenient way for the tester, and they do not need to know the internal mechanics of Intertia. Which I found in #604.