Skip to content

Commit 9717f8b

Browse files
committed
Update HistoryTest.php
1 parent ac136c9 commit 9717f8b

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

tests/HistoryTest.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,16 @@ public function test_the_fragment_can_be_retained_via_inertia_facade(): void
191191
return Inertia::render('User/Edit');
192192
});
193193

194-
$this->followingRedirects();
194+
$this->withoutExceptionHandling()->get('/');
195195

196-
$response = $this->withoutExceptionHandling()->get('/');
196+
$response = $this->withoutExceptionHandling()->get('/users', [
197+
'X-Inertia' => 'true',
198+
]);
197199

198200
$response->assertSuccessful();
199-
$this->assertStringContainsString('"retainFragment":true', $response->content());
201+
$response->assertJson([
202+
'retainFragment' => true,
203+
]);
200204
}
201205

202206
public function test_the_fragment_can_be_retained_via_redirect_macro(): void
@@ -209,11 +213,15 @@ public function test_the_fragment_can_be_retained_via_redirect_macro(): void
209213
return Inertia::render('User/Edit');
210214
});
211215

212-
$this->followingRedirects();
216+
$this->withoutExceptionHandling()->get('/');
213217

214-
$response = $this->withoutExceptionHandling()->get('/');
218+
$response = $this->withoutExceptionHandling()->get('/users', [
219+
'X-Inertia' => 'true',
220+
]);
215221

216222
$response->assertSuccessful();
217-
$this->assertStringContainsString('"retainFragment":true', $response->content());
223+
$response->assertJson([
224+
'retainFragment' => true,
225+
]);
218226
}
219227
}

0 commit comments

Comments
 (0)