8 Replies
The infolist entry is not a form field, I'm not sure
assertFormFieldIsHidden()
applies here.
Have you tried ->assertSee()
?
Or i guess ->assertDontSee()
in this case...As far as I know,
assertSee
is looking for text in HTML. My field is hidden and doesn't have a label so what do I need to assertSee
or assertDontSee
?As a last option you may want to use
assertDontSeeHtml
(?But what HTML do I need to don't see?
If you want to assert that an infolist entry is not visible, I'm thinking you can call
->assertDontSee($record->field_that_should_be_hidden)
The label is not a bad idea, it depends on the context. But if the field has no label, then all you can really test is the value.But the value is null. That's the point
Well then, how is this test useful? You're basically testing that the
hidden()
method from Filament is working correctly... Filament already has a test for that.hidden()
has a conditional logic, I simplify an example