From 9c568176ce2170ff7a3ed3fed6a7e2b3437affd9 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Wed, 24 Jul 2024 16:11:29 +0200 Subject: [PATCH] Fixed: Display all forms on index page --- app/Form/Actions/FormApiListAction.php | 2 +- tests/EndToEnd/Form/FormApiListActionTest.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/Form/Actions/FormApiListAction.php b/app/Form/Actions/FormApiListAction.php index c7a3299b..3c74d1e8 100644 --- a/app/Form/Actions/FormApiListAction.php +++ b/app/Form/Actions/FormApiListAction.php @@ -27,7 +27,7 @@ class FormApiListAction { return FormApiResource::collection($this->handle( $request->input('filter', ''), - $request->input('perPage', 10) + $request->input('perPage', 9999) )); } } diff --git a/tests/EndToEnd/Form/FormApiListActionTest.php b/tests/EndToEnd/Form/FormApiListActionTest.php index 3e52497f..c00c4d5b 100644 --- a/tests/EndToEnd/Form/FormApiListActionTest.php +++ b/tests/EndToEnd/Form/FormApiListActionTest.php @@ -117,4 +117,20 @@ class FormApiListActionTest extends FormTestCase $this->get('/api/form?filter=' . $this->filterString(['past' => true])) ->assertJsonCount(1, 'data'); } + + public function testItDisplaysAllForms(): void + { + Carbon::setTestNow(Carbon::parse('2023-03-02')); + Storage::fake('temp'); + $this->loginNami()->withoutExceptionHandling(); + Form::factory() + ->withImage('headerImage', 'lala-2.jpg') + ->from('2023-05-05') + ->to('2023-06-07') + ->count(20) + ->create(); + + sleep(1); + $this->get('/api/form')->assertJsonCount(20, 'data'); + } }