Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot pass BooleanFilter filters successfully on pest test #22

Open
erenmustafaozdal opened this issue Apr 8, 2023 · 0 comments
Open

Comments

@erenmustafaozdal
Copy link
Contributor

Hi @dmandrade, thank you very much for this useful package. You are doing a good job.

I'm having trouble with my BooleanFilter tests. It was working before I used filament-advancedfilter.

I wrote my tests as described in the filament documentation.

it('can filtering was done with is_active in the customers table.', function () {
    $customers = Customer::factory(10)->create();

    livewire(ListCustomers::class)
        ->assertCanSeeTableRecords($customers)
        ->filterTable('is_active')
        ->assertCanSeeTableRecords($customers->where('is_active', true))
        ->assertCanNotSeeTableRecords($customers->where('is_active', false));
});

The assertion assertCanNotNotSeeTableRecords($customers->where('is_active', false)) is currently failing when this test was running before.

The code I configured the filter is very simple. It is as follows.

BooleanFilter::make('is_active')

wire:model has tableFilters.is_active.clause. Can adding .clause cause this problem? Do you have a solution for this?

Laravel: v10.0.5
Filament: v2.17.23
Filament AdvancedFilter: v1.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant