/* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ /* global add_heuristic_tests */ "use strict"; add_heuristic_tests([ { // This bug happens only when the last element is address-lineX and // the field is identified by regular expressions in `HeuristicsRegExp` but is not // identified by regular expressions defined in `_parseAddressFields` fixtureData: `

`, expectedResult: [ { description: "Address Line1 in the last element and is not updated in _parsedAddressFields", default: { reason: "regex-heuristic", }, fields: [ { fieldName: "country" }, { fieldName: "tel" }, { fieldName: "address-line1" }, ], }, ], }, { fixtureData: `

`, expectedResult: [ { description: "Address Line2 in the last element and is not updated in _parsedAddressFields", default: { reason: "regex-heuristic", }, fields: [ { fieldName: "country" }, { fieldName: "tel" }, { fieldName: "address-line1" }, { fieldName: "address-line2" }, ], }, ], }, { // Bug 1833613 description: "street-address field is treated as address-line1 when address-line2 is present while adddress-line1 is not", fixtureData: `
`, expectedResult: [ { fields: [ { fieldName: "address-line1", reason: "regexp-heuristic" }, { fieldName: "address-line2", reason: "autocomplete" }, { fieldName: "email", reason: "autocomplete" }, ], }, ], }, { // Bug 1833613 description: "street-address field should not be treated as address-line1 when address-line2 is not present", fixtureData: `
`, expectedResult: [ { fields: [ { fieldName: "street-address", reason: "autocomplete" }, { fieldName: "address-line3", reason: "autocomplete" }, { fieldName: "email", reason: "autocomplete" }, ], }, ], }, { // Bug 1833613 description: "street-address field should not be treated as address-line1 when address-line1 is present", fixtureData: `
`, expectedResult: [ { fields: [ { fieldName: "street-address", reason: "autocomplete" }, { fieldName: "address-line1", reason: "autocomplete" }, { fieldName: "email", reason: "autocomplete" }, ], }, ], }, ]);