Skip to content
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

assertInertia() fails when testing Inertia visits #613

Closed
ignacio-dev opened this issue Apr 19, 2024 · 1 comment
Closed

assertInertia() fails when testing Inertia visits #613

ignacio-dev opened this issue Apr 19, 2024 · 1 comment

Comments

@ignacio-dev
Copy link

assertInertia() throws a Not a valid Inertia response error when simulating an Inertia.js visit like so:

$response = $this
    ->withHeaders([
        "accept" => "text/html, application/xhtml+xml",
        "content-type" => "application/json",
        "x-inertia" => "true",
        "x-inertia-partial-component" => "Post/Edit",
        "x-inertia-partial-data" => "post",
        "x-inertia-version" => "eaa52f64811e388602bb56eca093f022",
        "x-requested-with" => "XMLHttpRequest",
    ])
    ->get('/some-route')
    ->assertInertia(fn (AssertableInertia $page) => $page
        ->has('post')
    );
@driesvints
Copy link
Collaborator

Hey there,

Can you first please try one of the support channels below? If you can actually identify this as a bug, feel free to open up a new issue with a link to the original one and we'll gladly help you out.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants