[
{"name": "a primary submit button, GOV.UK's default", "args": [{"id": "save", "children": "Save and continue"}], "expect": "<button class=\"fune-button\" id=\"save\" type=\"submit\">Save and continue</button>"},
{"name": "no id given, none rendered", "args": [{"children": "Continue"}], "expect": "<button class=\"fune-button\" type=\"submit\">Continue</button>"},
{"name": "a secondary button", "args": [{"id": "find", "variant": "secondary", "type": "button", "children": "Find address"}], "expect": "<button class=\"fune-button fune-button--secondary\" id=\"find\" type=\"button\">Find address</button>"},
{"name": "a warning button for a destructive action", "args": [{"id": "delete", "variant": "warning", "children": "Delete account"}], "expect": "<button class=\"fune-button fune-button--warning\" id=\"delete\" type=\"submit\">Delete account</button>"},
{"name": "primary named explicitly has no modifier", "args": [{"id": "pay", "variant": "primary", "children": "Pay"}], "expect": "<button class=\"fune-button\" id=\"pay\" type=\"submit\">Pay</button>"},
{"name": "a reset button", "args": [{"id": "clear", "type": "reset", "variant": "secondary", "children": "Clear"}], "expect": "<button class=\"fune-button fune-button--secondary\" id=\"clear\" type=\"reset\">Clear</button>"},
{"name": "name and value say which submit button was pressed", "args": [{"id": "add", "name": "action", "value": "add-another", "variant": "secondary", "children": "Add another"}], "expect": "<button class=\"fune-button fune-button--secondary\" id=\"add\" type=\"submit\" value=\"add-another\" name=\"action\">Add another</button>"},
{"name": "disabled as GOV.UK renders it: the attribute and aria-disabled", "args": [{"id": "send", "disabled": true, "children": "Disabled button"}], "expect": "<button class=\"fune-button\" id=\"send\" type=\"submit\" disabled=\"\" aria-disabled=\"true\">Disabled button</button>"},
{"name": "loading stays enabled and focusable, aria-disabled, with its loading text", "args": [{"id": "send", "loading": true, "loadingText": "Sending", "children": "Confirm and send"}], "expect": "<button class=\"fune-button fune-button--loading\" id=\"send\" type=\"submit\" aria-disabled=\"true\">Sending</button>"},
{"name": "loading without loading text keeps the children", "args": [{"id": "send", "loading": true, "children": "Confirm and send"}], "expect": "<button class=\"fune-button fune-button--loading\" id=\"send\" type=\"submit\" aria-disabled=\"true\">Confirm and send</button>"},
{"name": "loading text is ignored when not loading", "args": [{"id": "send", "loading": false, "disabled": false, "loadingText": "Sending", "children": "Confirm and send"}], "expect": "<button class=\"fune-button\" id=\"send\" type=\"submit\">Confirm and send</button>"},
{"name": "a class name comes after the modifiers", "args": [{"id": "x", "variant": "warning", "loading": true, "className": "wide", "children": "Remove"}], "expect": "<button class=\"fune-button fune-button--warning fune-button--loading wide\" id=\"x\" type=\"submit\" aria-disabled=\"true\">Remove</button>"},
{"name": "text is escaped", "args": [{"id": "x", "children": "Save & <continue>", "value": "a\"b"}], "expect": "<button class=\"fune-button\" id=\"x\" type=\"submit\" value=\"a"b\">Save & <continue></button>"}
]