public function test_making_an_api_request(): void
{
$response = $this->postJson('/api/user', ['name' => 'Sally']);
$response
->assertStatus(201)
->assertJson([
'created' => true,
]);
}
if you need a browser interaction instead of request-response test, you will need browser test (e.g. a dusk test), read more here: https://laravel.com/docs/11.x/dusk
@s4muel thanks for your response.
okay I thought Ajax form submission would be done by some otherway, this is done by same as api testing.
But my question is how can I check code writen inside ajax success method like redirect to another page and and how can I check js form validation before executing ajax request.