Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

filament-testing

verified

Generate Pest tests for FilamentPHP v4 resources, forms, tables, and authorization

View on GitHub

Marketplace

mwguerra-marketplace

mwguerra/claude-code-plugins

Plugin

filament-specialist

laravel

Repository

mwguerra/claude-code-plugins
15stars

filament-specialist/skills/filament-testing/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/mwguerra/claude-code-plugins/blob/main/filament-specialist/skills/filament-testing/SKILL.md -a claude-code --skill filament-testing

Installation paths:

Claude
.claude/skills/filament-testing/
Powered by add-skill CLI

Instructions

# FilamentPHP Testing Skill

## Overview

This skill generates comprehensive Pest tests for FilamentPHP v4 components following official testing documentation patterns.

## Documentation Reference

**CRITICAL:** Before generating tests, read:
- `/home/mwguerra/projects/mwguerra/claude-code-plugins/filament-specialist/skills/filament-docs/references/general/10-testing/`

## Test Setup

### Base Test Configuration

```php
<?php

declare(strict_types=1);

namespace Tests;

use Illuminate\Foundation\Testing\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
{
    use CreatesApplication;

    protected function setUp(): void
    {
        parent::setUp();

        // Login as admin for Filament tests
        $this->actingAs(\App\Models\User::factory()->create([
            'is_admin' => true,
        ]));
    }
}
```

### Pest Configuration

```php
// tests/Pest.php
uses(Tests\TestCase::class)
    ->in('Feature');

uses(Illuminate\Foundation\Testing\RefreshDatabase::class)
    ->in('Feature');
```

## Resource Tests

### List Page Tests

```php
<?php

declare(strict_types=1);

use App\Filament\Resources\PostResource;
use App\Filament\Resources\PostResource\Pages\ListPosts;
use App\Models\Post;
use App\Models\User;
use Filament\Actions\DeleteAction;
use Filament\Tables\Actions\DeleteBulkAction;

use function Pest\Livewire\livewire;

beforeEach(function () {
    $this->user = User::factory()->create(['is_admin' => true]);
    $this->actingAs($this->user);
});

it('can render the list page', function () {
    livewire(ListPosts::class)
        ->assertSuccessful();
});

it('can list posts', function () {
    $posts = Post::factory()->count(10)->create();

    livewire(ListPosts::class)
        ->assertCanSeeTableRecords($posts);
});

it('can render post title column', function () {
    Post::factory()->create(['title' => 'Test Post Title']);

    livewire(ListPosts::class)
        ->assertCanRenderTableColumn('title');
});

it('can search posts by title

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
14724 chars