feat: reload the page with a flash when an htmx request fails
This commit is contained in:
1 parent
0be3c2ccde
commit
a2e4035889
14 files changed
+205
-210
No files matched your search
@@ -43,8 +43,7 @@ class ResourceAdminControllerTest extends WebTestCase
|
||||
$this->client->request('GET', '/admin/resources');
|
||||
self::assertResponseStatusCodeSame(Response::HTTP_FORBIDDEN);
|
||||
|
||||
// Not as htmx: an htmx request gets the error modal instead of the bare status.
|
||||
$this->client->request('GET', '/admin/resources/new/desk');
|
||||
$this->client->request('GET', '/admin/resources/new/desk', server: ['HTTP_HX-Request' => 'true']);
|
||||
self::assertResponseStatusCodeSame(Response::HTTP_FORBIDDEN);
|
||||
}
|
||||
|
||||
@@ -123,7 +122,7 @@ class ResourceAdminControllerTest extends WebTestCase
|
||||
{
|
||||
$this->client->loginUser($this->admin());
|
||||
|
||||
$this->client->request('GET', '/admin/resources/new/boat');
|
||||
$this->client->request('GET', '/admin/resources/new/boat', server: ['HTTP_HX-Request' => 'true']);
|
||||
|
||||
self::assertResponseStatusCodeSame(Response::HTTP_NOT_FOUND);
|
||||
}
|
||||
@@ -221,7 +220,7 @@ class ResourceAdminControllerTest extends WebTestCase
|
||||
$crawler = $this->client->request('GET', '/admin/resources');
|
||||
self::assertCount(0, $crawler->filter(\sprintf('[hx-get="/admin/resource-groups/%d/delete"]', $room->getId())));
|
||||
|
||||
$this->client->request('POST', \sprintf('/admin/resource-groups/%d/delete', $room->getId()), ['_token' => 'whatever']);
|
||||
$this->client->request('POST', \sprintf('/admin/resource-groups/%d/delete', $room->getId()), ['_token' => 'whatever'], server: ['HTTP_HX-Request' => 'true']);
|
||||
self::assertResponseStatusCodeSame(Response::HTTP_FORBIDDEN);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user