Add test for choice
This commit is contained in:
parent
3b1a5cc2b4
commit
5930d8a31f
1 changed files with 10 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
||||||
:choicep
|
:choicep
|
||||||
:choicesp
|
:choicesp
|
||||||
:questionp
|
:questionp
|
||||||
|
:choice
|
||||||
:question
|
:question
|
||||||
:resolve-input-type
|
:resolve-input-type
|
||||||
:resolve-input-and-choice
|
:resolve-input-and-choice
|
||||||
|
@ -54,6 +55,15 @@
|
||||||
(ok (equal choices '("A" "B"))))
|
(ok (equal choices '("A" "B"))))
|
||||||
(ok (signals (resolve-input-and-choice '("A" "B"))))))
|
(ok (signals (resolve-input-and-choice '("A" "B"))))))
|
||||||
|
|
||||||
|
(deftest test-choice-radio
|
||||||
|
(let ((result (spinneret:with-html-string
|
||||||
|
(choice "hobbies" (:radio "Reading" "Swimming" "Coding")))))
|
||||||
|
(testing "Generates correct HTML for choice"
|
||||||
|
(ok (search "type=radio" result))
|
||||||
|
(ok (search "for=group-hobbies-reading" result))
|
||||||
|
(ok (search "for=group-hobbies-swimming" result))
|
||||||
|
(ok (search "for=group-hobbies-coding" result)))))
|
||||||
|
|
||||||
(deftest test-question-radio
|
(deftest test-question-radio
|
||||||
(let ((result (spinneret:with-html-string
|
(let ((result (spinneret:with-html-string
|
||||||
(question "What is your favorite color?"
|
(question "What is your favorite color?"
|
||||||
|
|
Loading…
Add table
Reference in a new issue