© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
18 replies
Shaung Bhone

Filament form with laravel pest.

This test fail sometimes. Where am I do wrong?
it(
    'can ensure there are no validation errors',
    fn() => [
        actingAs(\App\Models\User::factory()->create()),

        ($status = \App\Models\Status::factory()->create([
            'name' => 'Status is opening',
        ])),

        ($category = \App\Models\Category::factory()->create([
            'name' => 'This is category one',
        ])),

        livewire(CreateFeeling::class)
            ->fillForm([
                'title' => fake()->sentence(),
                'description' => fake()->sentence(),
                'category_id' => $category->id,
                'status_id' => $status->id,
            ])
            ->call('create')
            ->assertHasNoFormErrors([
                'title' => 'required',
                'description' => 'required',
            ]),
    ],
);
it(
    'can ensure there are no validation errors',
    fn() => [
        actingAs(\App\Models\User::factory()->create()),

        ($status = \App\Models\Status::factory()->create([
            'name' => 'Status is opening',
        ])),

        ($category = \App\Models\Category::factory()->create([
            'name' => 'This is category one',
        ])),

        livewire(CreateFeeling::class)
            ->fillForm([
                'title' => fake()->sentence(),
                'description' => fake()->sentence(),
                'category_id' => $category->id,
                'status_id' => $status->id,
            ])
            ->call('create')
            ->assertHasNoFormErrors([
                'title' => 'required',
                'description' => 'required',
            ]),
    ],
);
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Filament v4 testing with Pest
FilamentFFilament / ❓┊help
5mo ago
Laravel Enum with Filament
FilamentFFilament / ❓┊help
3y ago
Laravel Pennant with Filament
FilamentFFilament / ❓┊help
3y ago
trying to test filament routes with pest
FilamentFFilament / ❓┊help
2y ago