Skip to content

Commit

Permalink
add clear history property
Browse files Browse the repository at this point in the history
  • Loading branch information
joetannenbaum committed Dec 5, 2024
1 parent d783ca2 commit bc897f8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public function toResponse($request)
'url' => Str::start(Str::after($request->fullUrl(), $request->getSchemeAndHttpHost()), '/'),
'version' => $this->version,
'encryptHistory' => false,
'clearHistory' => false,
];

if ($request->header(Header::INERTIA)) {
Expand Down
1 change: 1 addition & 0 deletions tests/ControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function test_controller_returns_an_inertia_response(): void
'url' => '/',
'version' => '',
'encryptHistory' => false,
'clearHistory' => false,
]);
}
}
2 changes: 1 addition & 1 deletion tests/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function test_server_response(): void
$this->assertSame('Jonathan', $page['props']['user']['name']);
$this->assertSame('/user/123', $page['url']);
$this->assertSame('123', $page['version']);
$this->assertSame('<div id="app" data-page="{&quot;component&quot;:&quot;User\/Edit&quot;,&quot;props&quot;:{&quot;user&quot;:{&quot;name&quot;:&quot;Jonathan&quot;}},&quot;url&quot;:&quot;\/user\/123&quot;,&quot;version&quot;:&quot;123&quot;,&quot;encryptHistory&quot;:false}"></div>', $view->render());
$this->assertSame('<div id="app" data-page="{&quot;component&quot;:&quot;User\/Edit&quot;,&quot;props&quot;:{&quot;user&quot;:{&quot;name&quot;:&quot;Jonathan&quot;}},&quot;url&quot;:&quot;\/user\/123&quot;,&quot;version&quot;:&quot;123&quot;,&quot;encryptHistory&quot;:false,&quot;clearHistory&quot;:false}"></div>', $view->render());
}

public function test_xhr_response(): void
Expand Down

0 comments on commit bc897f8

Please sign in to comment.