[
{"name": "a legend and three radios: the first takes the id, the rest -2 and -3", "args": [{"id": "contact", "legend": "How would you prefer to be contacted?", "options": [{"value": "email", "label": "Email"}, {"value": "phone", "label": "Phone"}, {"value": "text", "label": "Text message"}]}], "expect": "
"},
{"name": "inline yes and no, submitted under a name of its own", "args": [{"id": "changed", "name": "changedName", "legend": "Have you changed your name?", "inline": true, "options": [{"value": "yes", "label": "Yes"}, {"value": "no", "label": "No"}]}], "expect": ""},
{"name": "a controlled value checks only its radio", "args": [{"id": "yn", "legend": "Continue?", "value": "no", "options": [{"value": "yes", "label": "Yes"}, {"value": "no", "label": "No"}]}], "expect": ""},
{"name": "a default value checks its radio too", "args": [{"id": "yn", "legend": "Continue?", "defaultValue": "yes", "options": [{"value": "yes", "label": "Yes"}, {"value": "no", "label": "No"}]}], "expect": ""},
{"name": "a controlled empty value checks nothing, and wins over a default", "args": [{"id": "yn", "legend": "Continue?", "value": "", "defaultValue": "yes", "options": [{"value": "yes", "label": "Yes"}, {"value": "no", "label": "No"}]}], "expect": ""},
{"name": "an item hint describes its own radio, as -item-hint", "args": [{"id": "signIn", "legend": "How do you want to sign in?", "options": [{"value": "gateway", "label": "Sign in with Government Gateway", "hint": "You'll have a user ID if you've registered for Self Assessment"}, {"value": "verify", "label": "Sign in with GOV.UK Verify", "hint": "You'll have an account if you've already proved your identity"}]}], "expect": ""},
{"name": "an or divider before the last option", "args": [{"id": "where", "legend": "Where do you live?", "options": [{"value": "england", "label": "England"}, {"value": "wales", "label": "Wales"}, {"value": "abroad", "label": "I am a British citizen living abroad", "divider": "or"}]}], "expect": ""},
{"name": "hint and error describe the fieldset, hint first, and the legend is the page heading", "args": [{"id": "where", "legend": "Where do you live?", "isPageHeading": true, "hint": "Your main home", "error": "Select the country where you live", "options": [{"value": "england", "label": "England"}]}], "expect": ""},
{"name": "small, required, one option disabled", "args": [{"id": "freq", "legend": "How often?", "small": true, "required": true, "options": [{"value": "month", "label": "Monthly"}, {"value": "year", "label": "Yearly", "disabled": true}]}], "expect": ""},
{"name": "inline and small together; disabled disables every radio; a class name joins the wrapper's", "args": [{"id": "ok", "legend": "OK?", "inline": true, "small": true, "disabled": true, "className": "wide", "options": [{"value": "yes", "label": "Yes"}, {"value": "no", "label": "No"}]}], "expect": ""},
{"name": "labels and values are escaped", "args": [{"id": "e", "legend": "Q & A", "options": [{"value": "a&b", "label": " & \"B\""}]}], "expect": ""},
{"name": "no options is refused", "args": [{"id": "x", "legend": "Pick", "options": []}], "expectError": "a radio group needs at least one option"},
{"name": "two options with one value are refused", "args": [{"id": "x", "legend": "Pick", "options": [{"value": "yes", "label": "Yes"}, {"value": "yes", "label": "Yes please"}]}], "expectError": "radio option values must be unique: \"yes\" is there twice"},
{"name": "an id with a space is refused", "args": [{"id": "where live", "legend": "Where?", "options": [{"value": "a", "label": "A"}]}], "expectError": "a field id cannot contain spaces"}
]