Implemented a block editor for changing the layout of the page

This commit is contained in:
2026-04-04 01:17:05 +02:00
parent 0800f7664f
commit ff58e82497
41 changed files with 2706 additions and 298 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Tests\Feature;
use App\Models\PageBlock;
use App\Models\PreregistrationPage;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
@@ -19,20 +20,19 @@ class StorePreregistrationPageTest extends TestCase
$response = $this->actingAs($user)->post(route('admin.pages.store'), [
'title' => 'Summer Fest',
'heading' => 'Register',
'intro_text' => null,
'thank_you_message' => null,
'expired_message' => null,
'ticketshop_url' => null,
'start_date' => '2026-06-01T10:00',
'end_date' => '2026-06-30T18:00',
'phone_enabled' => false,
'is_active' => true,
]);
$response->assertRedirect(route('admin.pages.index'));
$this->assertDatabaseCount('preregistration_pages', 1);
$this->assertSame('Summer Fest', PreregistrationPage::query()->first()?->title);
$page = PreregistrationPage::query()->first();
$response->assertRedirect(route('admin.pages.edit', $page));
$this->assertSame('Summer Fest', $page?->title);
$this->assertGreaterThanOrEqual(4, PageBlock::query()->where('preregistration_page_id', $page?->id)->count());
}
public function test_validation_failure_redirects_back_with_input(): void
@@ -41,13 +41,11 @@ class StorePreregistrationPageTest extends TestCase
$response = $this->actingAs($user)->from(route('admin.pages.create'))->post(route('admin.pages.store'), [
'title' => '',
'heading' => 'H',
'start_date' => '2026-06-30T10:00',
'end_date' => '2026-06-01T10:00',
]);
$response->assertRedirect(route('admin.pages.create'));
$response->assertSessionHasErrors('title');
$response->assertSessionHasInput('heading', 'H');
}
}