You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #2517 [LiveComponent] Add Documentation for testing with LiveCollectionType (yalit)
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
[LiveComponent] Add Documentation for testing with LiveCollectionType
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| Issues | Fix#2512
| License | MIT
As mentioned in the #2512, I had trouble testing the submission of a form containing a LiveCollectionType field due to lack of proper guidance in the documentation. Hence this pull request to propose an addendum in the documentation linked to that capability
Commits
-------
fd208f8 [LiveComponent] Add Documentation for testing with LiveCollectionType
To test the submission of a form within a Live Component (with the above ``submitForm`` helper) containing a ``LiveCollectionType``, you first need to programmatically add the desired number of entries to the form, replicating the action of clicking the "Add" button.
3818
+
3819
+
So, if the following are the forms used::
3820
+
3821
+
use Symfony\UX\LiveComponent\Form\Type\LiveCollectionType;
3822
+
3823
+
// Parent FormType used in the Live Component
3824
+
class LiveCollectionFormType extends AbstractType
3825
+
{
3826
+
public function buildForm(FormBuilderInterface $builder, array $options): void
0 commit comments