Hi @joshgaber, thanks for this handy helper package. I came across the use-case to assert that the defined field has the given Nova field type. Useful e.g. to assert that an E-mail is rendered with the dedicated Laravel\Nova\Fields\Email component instead of a generic Text component.
I've added tests for the new method, as well as an InvalidFieldTypeException to have a nicer error message if the assertion receives an invalid class-string.
I also think that publicly exposing MockComponent::$component might come in handy for cases where we want to perform custom assertions on the actual component rather than the MockComponent. If access is restricted for a reason, I can drop those from the PR.
Hi @joshgaber, thanks for this handy helper package. I came across the use-case to assert that the defined field has the given Nova field type. Useful e.g. to assert that an E-mail is rendered with the dedicated
Laravel\Nova\Fields\Email
component instead of a genericText
component.I've added tests for the new method, as well as an
InvalidFieldTypeException
to have a nicer error message if the assertion receives an invalid class-string.I also think that publicly exposing
MockComponent::$component
might come in handy for cases where we want to perform custom assertions on the actual component rather than the MockComponent. If access is restricted for a reason, I can drop those from the PR.