Skip to content

Commit

Permalink
Update tests to follow Inertia convention (#721)
Browse files Browse the repository at this point in the history
  • Loading branch information
nexxai authored Dec 18, 2024
1 parent 2c6623d commit 2a743d5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/Feature/Lexers/StatementLexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ public function it_returns_a_render_statement_with_data(): void
public function it_returns_an_inertia_statement_with_data(): void
{
$tokens = [
'inertia' => 'post.index with:foo,bar,baz',
'inertia' => 'Post/Index with:foo,bar,baz',
];

$actual = $this->subject->analyze($tokens);

$this->assertCount(1, $actual);
$this->assertInstanceOf(InertiaStatement::class, $actual[0]);

$this->assertEquals('post.index', $actual[0]->view());
$this->assertEquals('Post/Index', $actual[0]->view());
$this->assertEquals(['foo', 'bar', 'baz'], $actual[0]->data());
}

Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/controllers/inertia-render.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function show(Request $request, Customer $customer): Response
{
$customers = Customer::all();

return Inertia::render('customer.show', [
return Inertia::render('Customer/Show', [
'customer' => $customer,
'customers' => $customers,
]);
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/drafts/inertia-render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ controllers:
Customer:
show:
query: all
inertia: customer.show with:customer,customers
inertia: Customer/Show with:customer,customers

0 comments on commit 2a743d5

Please sign in to comment.