Skip to content

Commit da93736

Browse files
committed
add test for inertia
1 parent 31e9d9d commit da93736

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/Auth/ElevatedSessionTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,19 @@ public function frontend_can_confirm_elevated_session_via_json()
680680
->assertSessionHas('statamic_elevated_session', now()->timestamp);
681681
}
682682

683+
#[Test]
684+
public function frontend_can_confirm_elevated_session_via_inertia()
685+
{
686+
redirect()->setIntendedUrl('/target-url');
687+
688+
$this
689+
->actingAs($this->user)
690+
->post('/!/auth/elevated-session', ['password' => 'secret'], ['X-Inertia' => 'true'])
691+
->assertStatus(409)
692+
->assertHeader('X-Inertia-Location', 'http://localhost/target-url')
693+
->assertSessionHas('statamic_elevated_session', now()->timestamp);
694+
}
695+
683696
#[Test]
684697
public function frontend_cannot_confirm_elevated_session_with_incorrect_password()
685698
{

0 commit comments

Comments
 (0)