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/heuristics/browser_multiple_section.js | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.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/heuristics/browser_multiple_section.js')
-rw-r--r-- | browser/extensions/formautofill/test/browser/heuristics/browser_multiple_section.js | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/browser/extensions/formautofill/test/browser/heuristics/browser_multiple_section.js b/browser/extensions/formautofill/test/browser/heuristics/browser_multiple_section.js new file mode 100644 index 0000000000..078f2240db --- /dev/null +++ b/browser/extensions/formautofill/test/browser/heuristics/browser_multiple_section.js @@ -0,0 +1,118 @@ +/* global add_heuristic_tests */ + +"use strict"; + +add_heuristic_tests( + [ + { + fixturePath: "multiple_section.html", + expectedResult: [ + { + default: { + reason: "autocomplete", + addressType: "shipping", + }, + fields: [ + { fieldName: "name", addressType: "" }, + { fieldName: "organization", addressType: "" }, + { fieldName: "street-address" }, + { fieldName: "address-level2" }, + { fieldName: "address-level1" }, + { fieldName: "postal-code" }, + { fieldName: "country" }, + ], + }, + { + default: { + reason: "autocomplete", + addressType: "billing", + }, + fields: [ + { fieldName: "street-address" }, + { fieldName: "address-level2" }, + { fieldName: "address-level1" }, + { fieldName: "postal-code" }, + { fieldName: "country" }, + ], + }, + { + default: { + reason: "autocomplete", + section: "section-my", + }, + fields: [ + { fieldName: "street-address" }, + { fieldName: "address-level2" }, + { fieldName: "address-level1" }, + { fieldName: "postal-code" }, + { fieldName: "country" }, + { fieldName: "tel", section: "", contactType: "work" }, + { fieldName: "email", section: "", contactType: "work" }, + ], + }, + { + invalid: true, + default: { + reason: "autocomplete", + }, + fields: [ + // Even the `contactType` of these two fields are different with the + // above two, we still consider they are identical until supporting + // multiple phone number and email in one profile. + { fieldName: "tel", contactType: "home" }, + { fieldName: "email", contactType: "home" }, + ], + }, + { + default: { + reason: "autocomplete", + }, + fields: [ + { fieldName: "name" }, + { fieldName: "organization" }, + { fieldName: "street-address" }, + { fieldName: "address-level2" }, + { fieldName: "address-level1" }, + { fieldName: "postal-code" }, + { fieldName: "country" }, + ], + }, + { + default: { + reason: "autocomplete", + }, + fields: [ + { fieldName: "street-address" }, + { fieldName: "address-level2" }, + { fieldName: "address-level1" }, + { fieldName: "postal-code" }, + { fieldName: "country" }, + ], + }, + { + default: { + reason: "autocomplete", + }, + fields: [ + { fieldName: "street-address" }, + { fieldName: "address-level2" }, + { fieldName: "address-level1" }, + { fieldName: "postal-code" }, + { fieldName: "country" }, + { fieldName: "tel", contactType: "work" }, + { fieldName: "email", contactType: "work" }, + ], + }, + { + invalid: true, + default: { + reason: "autocomplete", + contactType: "home", + }, + fields: [{ fieldName: "tel" }, { fieldName: "email" }], + }, + ], + }, + ], + "fixtures/" +); |