diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /browser/extensions/formautofill/test/browser/browser_autofill_address_select.js | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/extensions/formautofill/test/browser/browser_autofill_address_select.js')
-rw-r--r-- | browser/extensions/formautofill/test/browser/browser_autofill_address_select.js | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/browser/extensions/formautofill/test/browser/browser_autofill_address_select.js b/browser/extensions/formautofill/test/browser/browser_autofill_address_select.js new file mode 100644 index 0000000000..68e38ad10d --- /dev/null +++ b/browser/extensions/formautofill/test/browser/browser_autofill_address_select.js @@ -0,0 +1,64 @@ +/* Any copyright is dedicated to the Public Domain. +http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_PROFILE_US = { + email: "address_us@mozilla.org", + organization: "Mozilla", + country: "US", +}; + +const TEST_PROFILE_CA = { + email: "address_ca@mozilla.org", + organization: "Mozilla", + country: "CA", +}; + +const MARKUP_SELECT_COUNTRY = ` + <html><body> + <input id="email" autocomplete="email"> + <input id="organization" autocomplete="organization"> + <select id="country""" autocomplete="country"> + <option value="Germany">Germany</option> + <option value="Canada">Canada</option> + <option value="United States">United States</option> + <option value="France">France</option> + </select> + </body></html> +`; + +add_autofill_heuristic_tests([ + { + fixtureData: MARKUP_SELECT_COUNTRY, + profile: TEST_PROFILE_US, + expectedResult: [ + { + default: { + reason: "autocomplete", + }, + fields: [ + { fieldName: "email", autofill: TEST_PROFILE_US.email }, + { fieldName: "organization", autofill: TEST_PROFILE_US.organization }, + { fieldName: "country", autofill: "United States" }, + ], + }, + ], + }, + { + fixtureData: MARKUP_SELECT_COUNTRY, + profile: TEST_PROFILE_CA, + expectedResult: [ + { + default: { + reason: "autocomplete", + }, + fields: [ + { fieldName: "email", autofill: TEST_PROFILE_CA.email }, + { fieldName: "organization", autofill: TEST_PROFILE_CA.organization }, + { fieldName: "country", autofill: "Canada" }, + ], + }, + ], + }, +]); |