seed(RolePermissionSeeder::class); Queue::fake(); $this->actingAs($this->userWithRoles('admin')); } #[Test] public function every_content_form_renders_empty(): void { foreach ([PageResource::class, ProjectResource::class, MemberResource::class] as $resource) { $this->get($resource::getUrl('create'))->assertSuccessful(); } } #[Test] public function every_content_form_renders_with_an_image_and_its_description(): void { $page = Page::factory()->create([ 'featured_image' => 'pages/hero.jpg', 'featured_image_alt' => ['es' => 'Una captura'], ]); $project = Project::factory()->create([ 'cover_image' => 'projects/cover.jpg', 'cover_image_alt' => ['es' => 'La portada'], ]); $member = Member::factory()->create(['avatar' => 'members/ada.jpg']); // The alt-text tabs only appear once there is an image to describe, // so a form carrying one exercises a path the empty one does not. $this->get(PageResource::getUrl('edit', ['record' => $page]))->assertSuccessful(); $this->get(ProjectResource::getUrl('edit', ['record' => $project]))->assertSuccessful(); $this->get(MemberResource::getUrl('edit', ['record' => $member]))->assertSuccessful(); } }