[ {"name": "pounds: £ as an aria-hidden prefix, a decimal keyboard, no spell check", "args": [{"id": "amount", "label": "Amount, in pounds", "currency": "GBP", "locale": "en-GB", "rules": {"label": "Amount", "required": true, "min": 100, "max": 1000000, "allowNegative": false}}], "expect": "
£
"}, {"name": "kronor in sv-SE: kr is written after the amount, so it is a suffix", "args": [{"id": "belopp", "label": "Amount, in kronor", "currency": "SEK", "locale": "sv-SE", "rules": {"label": "Amount", "required": true, "min": null, "max": null, "allowNegative": false}, "value": "1 234,50"}], "expect": "
kr
"}, {"name": "a hint and a controlled value", "args": [{"id": "amount", "label": "Amount, in pounds", "currency": "GBP", "locale": "en-GB", "rules": {"label": "Amount", "required": true, "min": 100, "max": 1000000, "allowNegative": false}, "hint": "For example, 1,234.50", "value": "1,234.50"}], "expect": "
For example, 1,234.50
£
"}, {"name": "empty and required with showError: Enter amount", "args": [{"id": "amount", "label": "Amount, in pounds", "currency": "GBP", "locale": "en-GB", "rules": {"label": "Amount", "required": true, "min": 100, "max": 1000000, "allowNegative": false}, "showError": true, "value": ""}], "expect": "

Error: Enter amount

£
"}, {"name": "below the minimum with showError: the amount in the message", "args": [{"id": "amount", "label": "Amount, in pounds", "currency": "GBP", "locale": "en-GB", "rules": {"label": "Amount", "required": true, "min": 100, "max": 1000000, "allowNegative": false}, "showError": true, "value": "0.50"}], "expect": "

Error: Amount must be between £1.00 and £10,000.00

£
"}, {"name": "too many decimal places for the currency", "args": [{"id": "amount", "label": "Amount, in pounds", "currency": "GBP", "locale": "en-GB", "rules": {"label": "Amount", "required": true, "min": 100, "max": 1000000, "allowNegative": false}, "showError": true, "value": "12.345"}], "expect": "

Error: Amount must not have more than 2 decimal places

£
"}, {"name": "de-DE reads 1.234,50 as valid: no error", "args": [{"id": "betrag", "label": "Betrag in Euro", "currency": "EUR", "locale": "de-DE", "rules": {"label": "Amount", "required": true, "min": 100, "max": 1000000, "allowNegative": false}, "showError": true, "value": "1.234,50"}], "expect": "
€
"}, {"name": "en-GB grouping typed in a de-DE field is the wrong format", "args": [{"id": "betrag", "label": "Betrag in Euro", "currency": "EUR", "locale": "de-DE", "rules": {"label": "Amount", "required": true, "min": null, "max": null, "allowNegative": false}, "showError": true, "value": "1,234.50"}], "expect": "

Error: Enter amount in the correct format, like 1.234,50

€
"}, {"name": "yen has no minor unit: a whole number, prefix ¥", "args": [{"id": "yen", "label": "Amount, in yen", "currency": "JPY", "locale": "ja-JP", "rules": {"label": "Amount", "required": false, "min": null, "max": null, "allowNegative": false}, "showError": true, "value": "1.5"}], "expect": "

Error: Amount must be a whole number

¥
"}, {"name": "no check until showError", "args": [{"id": "amount", "label": "Amount, in pounds", "currency": "GBP", "locale": "en-GB", "rules": {"label": "Amount", "required": true, "min": 100, "max": 1000000, "allowNegative": false}, "defaultValue": "abc"}], "expect": "
£
"}, {"name": "an error passed in wins", "args": [{"id": "amount", "label": "Amount, in pounds", "currency": "GBP", "locale": "en-GB", "rules": {"label": "Amount", "required": true, "min": 100, "max": 1000000, "allowNegative": false}, "showError": true, "value": "5.00", "error": "You do not have enough money in this account"}], "expect": "

Error: You do not have enough money in this account

£
"}, {"name": "name, autocomplete, disabled and a class of its own", "args": [{"id": "amount", "name": "amountText", "label": "Amount, in pounds", "currency": "GBP", "locale": "en-GB", "rules": {"label": "Amount", "required": true, "min": 100, "max": 1000000, "allowNegative": false}, "autoComplete": "transaction-amount", "disabled": true, "className": "app-amount"}], "expect": "
£
"}, {"name": "an unknown locale throws: a bug in the page", "args": [{"id": "a", "label": "Amount", "currency": "GBP", "locale": "xx-YY", "rules": {"label": "Amount", "required": true, "min": 100, "max": 1000000, "allowNegative": false}}], "expectError": "unknown locale"}, {"name": "an unknown currency throws", "args": [{"id": "a", "label": "Amount", "currency": "ZZZ", "locale": "en-GB", "rules": {"label": "Amount", "required": true, "min": 100, "max": 1000000, "allowNegative": false}}], "expectError": "ZZZ"} ]