@@ -24,10 +24,10 @@ public function test_an_ungrouped_checkbox(): void
24
24
->id ('foo-box ' )
25
25
->withoutGroup ();
26
26
27
- $ this ->assertSelectorExists ($ html , ' div .form-check ' );
28
- $ this ->assertSelectorAttribute ($ html , 'div.form-check > input.form-check -input ' , 'name ' , 'demo ' );
29
- $ this ->assertSelectorAttribute ($ html , 'div.form-check > label.form-check -label ' , 'for ' , 'foo-box ' );
30
- $ this ->assertSelectorContainsText ($ html , 'div.form-check > label.form-check -label ' , 'Demo checkbox ' );
27
+ $ this ->assertSelectorDoesNotExist ($ html ,' .form-group ' );
28
+ $ this ->assertSelectorAttribute ($ html , 'input.custom-control -input ' , 'name ' , 'demo ' );
29
+ $ this ->assertSelectorAttribute ($ html , 'label.custom-control -label ' , 'for ' , 'foo-box ' );
30
+ $ this ->assertSelectorContainsText ($ html , 'label.custom-control -label ' , 'Demo checkbox ' );
31
31
}
32
32
33
33
public function test_a_select_form (): void
@@ -61,7 +61,7 @@ public function test_submit_button_html()
61
61
->id ('foo-submit-button ' );
62
62
63
63
$ this ->assertSelectorAttribute ($ html , 'button ' , 'type ' , 'submit ' );
64
- $ this ->assertSelectorAttribute ($ html , 'button ' , 'class ' , 'btn btn-primary ' );
64
+ $ this ->assertSelectorAttribute ($ html , 'button ' , 'class ' , 'btn btn-primary ' );
65
65
$ this ->assertSelectorAttribute ($ html , 'button ' , 'id ' , 'foo-submit-button ' );
66
66
$ this ->assertSelectorContainsText ($ html , 'button ' , 'Submit Awesome ' );
67
67
}
@@ -71,7 +71,17 @@ public function test_radio_group_form() : void
71
71
$ html = $ this ->aire ()->form ()
72
72
->radioGroup (['radio-1 ' =>'Radio 1 ' ,'radio-2 ' =>'Radio 2 ' ],'radio_selector ' ,'Foo Radio Selector ' );
73
73
74
- $ this ->assertSelectorAttribute ($ html , 'div.form-check > input.form-check-input ' , 'value ' , 'radio-1 ' );
75
- $ this ->assertSelectorContainsText ($ html ,'div.form-check > label.form-check-label ' ,'Radio 1 ' );
74
+ $ this ->assertSelectorContainsText ($ html , 'div.form-group > label ' , 'Foo Radio Selector ' );
75
+ $ this ->assertSelectorAttribute ($ html ,'div.custom-control.custom-radio > input.custom-control-input ' ,'value ' , 'radio-1 ' );
76
+ $ this ->assertSelectorAttribute ($ html ,'div.custom-control.custom-radio + div.custom-control.custom-radio > input.custom-control-input ' ,'value ' , 'radio-2 ' );
77
+ }
78
+
79
+ public function test_when_no_label_given_a_label_is_not_generated () : void
80
+ {
81
+ $ html = $ this ->aire ()
82
+ ->form ()
83
+ ->input ('text-input ' );
84
+
85
+ $ this ->assertSelectorDoesNotExist ($ html , 'label ' );
76
86
}
77
87
}
0 commit comments