[ { "name": "a legend and the inputs", "args": [{ "id": "address", "legend": "What is your address?", "children": "[inputs]" }], "expect": "
What is your address?[inputs]
" }, { "name": "a hint describes the whole group", "args": [{ "id": "dob", "legend": "What is your date of birth?", "hint": "For example, 31 3 1980", "children": "[inputs]" }], "expect": "
What is your date of birth?
For example, 31 3 1980
[inputs]
" }, { "name": "an error marks the group and describes it", "args": [{ "id": "contact", "legend": "How would you like to be contacted?", "error": "Select how you would like to be contacted", "children": "[inputs]" }], "expect": "
How would you like to be contacted?

Error: Select how you would like to be contacted

[inputs]
" }, { "name": "hint then error, both described, hint first", "args": [{ "id": "dob", "legend": "Date of birth", "hint": "For example, 31 3 1980", "error": "Date of birth must be in the past", "children": "[inputs]" }], "expect": "
Date of birth
For example, 31 3 1980

Error: Date of birth must be in the past

[inputs]
" }, { "name": "the legend as the page heading holds an h1", "args": [{ "id": "where", "legend": "Where do you live?", "isPageHeading": true, "children": "[inputs]" }], "expect": "

Where do you live?

[inputs]
" }, { "name": "isPageHeading false is an ordinary legend", "args": [{ "id": "where", "legend": "Where do you live?", "isPageHeading": false }], "expect": "
Where do you live?
" }, { "name": "a class name joins the wrapper's, after the error class", "args": [{ "id": "a", "legend": "Address", "error": "Enter your address", "className": "fune-field--wide" }], "expect": "
Address

Error: Enter your address

" }, { "name": "empty hint and null error show nothing", "args": [{ "id": "a", "legend": "Address", "hint": "", "error": null, "children": "[inputs]" }], "expect": "
Address[inputs]
" }, { "name": "the legend is escaped", "args": [{ "id": "a", "legend": "Terms & " }], "expect": "
Terms & <conditions>
" }, { "name": "an id with a space is refused", "args": [{ "id": "home address", "legend": "Address" }], "expectError": "a field id cannot contain spaces" } ]