summaryrefslogtreecommitdiffstats
path: root/browser/extensions/formautofill/test/unit/test_autofillFormFields.js
diff options
context:
space:
mode:
Diffstat (limited to 'browser/extensions/formautofill/test/unit/test_autofillFormFields.js')
-rw-r--r--browser/extensions/formautofill/test/unit/test_autofillFormFields.js35
1 files changed, 34 insertions, 1 deletions
diff --git a/browser/extensions/formautofill/test/unit/test_autofillFormFields.js b/browser/extensions/formautofill/test/unit/test_autofillFormFields.js
index 49ffb0083a..be6b142195 100644
--- a/browser/extensions/formautofill/test/unit/test_autofillFormFields.js
+++ b/browser/extensions/formautofill/test/unit/test_autofillFormFields.js
@@ -423,6 +423,39 @@ const TESTCASES = [
},
{
description:
+ "Form with hidden input and visible input that share the same autocomplete attribute",
+ document: `<form>
+ <input id="hidden-cc" autocomplete="cc-number" hidden>
+ <input id="hidden-cc-2" autocomplete="cc-number" style="display:none">
+ <input id="visible-cc" autocomplete="cc-number">
+ <input id="hidden-name" autocomplete="cc-name" hidden>
+ <input id="hidden-name-2" autocomplete="cc-name" style="display:none">
+ <input id="visible-name" autocomplete="cc-name">
+ <input id="cc-exp-month" autocomplete="cc-exp-month">
+ <input id="cc-exp-year" autocomplete="cc-exp-year">
+ </form>`,
+ focusedInputId: "visible-cc",
+ profileData: {
+ guid: "123",
+ "cc-number": "4111111111111111",
+ "cc-name": "test name",
+ "cc-exp-month": 6,
+ "cc-exp-year": 25,
+ },
+ expectedResult: {
+ guid: "123",
+ "visible-cc": "4111111111111111",
+ "visible-name": "test name",
+ "cc-exp-month": "06",
+ "cc-exp-year": "25",
+ "hidden-cc": "4111111111111111",
+ "hidden-cc-2": "4111111111111111",
+ "hidden-name": "test name",
+ "hidden-name-2": "test name",
+ },
+ },
+ {
+ description:
"Fill credit card fields in a form where the value property is being used as a placeholder for cardholder name",
document: `<form>
<input id="cc-number" autocomplete="cc-number">
@@ -862,7 +895,7 @@ function do_test(testcases, testFn) {
// Replace the internal decrypt method with OSKeyStore API,
// but don't pass the reauth parameter to avoid triggering
// reauth login dialog in these tests.
- let decryptHelper = async (cipherText, reauth) => {
+ let decryptHelper = async (cipherText, _reauth) => {
return OSKeyStore.decrypt(cipherText, false);
};
handler.collectFormFields();