15
15
use Symfony \Component \DomCrawler \Crawler ;
16
16
use Symfony \Component \Form \FormFactoryInterface ;
17
17
use Symfony \UX \LiveComponent \Tests \Fixtures \Component \FormWithCollectionTypeComponent ;
18
+ use Symfony \UX \LiveComponent \Tests \Fixtures \Factory \CategoryFixtureEntityFactory ;
18
19
use Symfony \UX \LiveComponent \Tests \Fixtures \Form \BlogPostFormType ;
19
20
use Symfony \UX \LiveComponent \Tests \LiveComponentTestHelper ;
20
21
use Zenstruck \Browser \Test \HasBrowser ;
@@ -157,6 +158,9 @@ public function testFormRemembersValidationFromInitialForm(): void
157
158
158
159
public function testHandleCheckboxChanges (): void
159
160
{
161
+ $ category = CategoryFixtureEntityFactory::createMany (5 );
162
+ $ id = $ category [0 ]->getId ();
163
+
160
164
$ mounted = $ this ->mountComponent (
161
165
'form_with_many_different_fields_type ' ,
162
166
[
@@ -174,9 +178,12 @@ public function testHandleCheckboxChanges(): void
174
178
'textarea ' => '' ,
175
179
'range ' => '' ,
176
180
'choice ' => '' ,
181
+ 'choice_required_with_placeholder ' => '' ,
182
+ 'choice_required_without_placeholder ' => '2 ' ,
177
183
'choice_expanded ' => '' ,
178
184
'choice_multiple ' => ['2 ' ],
179
185
'select_multiple ' => ['2 ' ],
186
+ 'entity ' => (string ) $ id ,
180
187
'checkbox ' => null ,
181
188
'checkbox_checked ' => '1 ' ,
182
189
'file ' => '' ,
@@ -296,6 +303,7 @@ public function testLiveCollectionTypeAddButtonsByDefault(): void
296
303
297
304
public function testResetForm (): void
298
305
{
306
+ CategoryFixtureEntityFactory::createMany (5 );
299
307
$ mounted = $ this ->mountComponent ('form_with_many_different_fields_type ' );
300
308
301
309
$ dehydratedProps = $ this ->dehydrateComponent ($ mounted )->getProps ();
0 commit comments