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

[FIX] Update pages path to match the default one #88

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rashidlaasri
Copy link

@rashidlaasri rashidlaasri commented Mar 22, 2025

This PR renames the pages from pages to Pages in the resources/js to align with the default Inertia setup.

Currently, if you create an Inertia test to check if a component is rendered, it fails with a “component not found” error. This happens because Inertia looks for /js/Pages/, while the Starter Kit uses /js/pages/.

$this->get('/podcasts/41')
    ->assertInertia(fn (Assert $page) => $page
        ->component('Podcasts/Show')
        ->has('podcast')
    );

Right now, there are workarounds, but they require extra steps that shouldn't be necessary if we use the default Inertia path.

  1. Publish Inertia config file and update the value:
'page_paths' => [
    resource_path('js/pages'),
],
  1. Override the config file at run time:
config()->set('inertia.testing.page_paths', [resource_path('js/pages')])

While both these changes work, it feels like an extra step (a little bit hacky too) that shouldn't be needed if we used the default path.

Changes in this PR:

✅ Renames the folder to match Inertia’s default path.
✅ Updates app.ts to reflect this change.

This ensures consistency and prevents unnecessary setup issues for users. 🚀

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

Successfully merging this pull request may close these issues.

1 participant