File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6868
6969(defn radio-button
7070 " Creates a radio button."
71- ([id ]
72- (radio-button id (*params* id )))
73- ([id checked?]
74- (radio-button id checked? " true" ))
75- ([id checked? value]
71+ ([group ]
72+ (radio-button group (*params* group )))
73+ ([group checked?]
74+ (radio-button group checked? " true" ))
75+ ([group checked? value]
7676 [:input {:type " radio"
77- :name (str* id " _ " value )
78- :id (str* id )
77+ :name (str* group )
78+ :id (str* group " _ " value )
7979 :value value
8080 :checked checked?}]))
8181
Original file line number Diff line number Diff line change 3434(deftest test-radio-button
3535 (is (= (radio-button :foo )
3636 [:input {:type " radio"
37- :id " foo "
38- :name " foo_true "
37+ :id " foo_true "
38+ :name " foo "
3939 :value " true"
4040 :checked nil }])))
4141
4242(deftest test-radio-button-selected
4343 (is (= (radio-button :foo true " abcdef" )
4444 [:input {:type " radio"
45- :id " foo "
46- :name " foo_abcdef "
45+ :id " foo_abcdef "
46+ :name " foo "
4747 :value " abcdef"
4848 :checked true }])))
4949
You can’t perform that action at this time.
0 commit comments