/* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ /* global add_heuristic_tests */ "use strict"; add_heuristic_tests([ { description: "all fields are visible", fixtureData: `
`, expectedResult: [ { default: { reason: "autocomplete", }, fields: [ { fieldName: "name" }, { fieldName: "tel" }, { fieldName: "email" }, { fieldName: "country" }, { fieldName: "postal-code" }, { fieldName: "address-line1" }, { fieldName: "address-line2" }, ], }, ], }, { description: "some fields are invisible because of css style", fixtureData: `
`, expectedResult: [ { default: { reason: "autocomplete", }, fields: [ { fieldName: "name" }, { fieldName: "tel" }, { fieldName: "email" }, ], }, ], }, { // hidden and style="display:none" are always considered regardless what visibility check we use description: "invisible fields are identified because number of elemenent in the form exceed the threshold", prefs: [["extensions.formautofill.heuristics.visibilityCheckThreshold", 1]], fixtureData: `
`, expectedResult: [ { default: { reason: "autocomplete", }, fields: [ { fieldName: "name" }, { fieldName: "tel" }, { fieldName: "email" }, { fieldName: "address-line1" }, { fieldName: "address-line2" }, ], }, ], }, ]);