From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../test/unit/test_addressComponent_city.js | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 browser/extensions/formautofill/test/unit/test_addressComponent_city.js (limited to 'browser/extensions/formautofill/test/unit/test_addressComponent_city.js') diff --git a/browser/extensions/formautofill/test/unit/test_addressComponent_city.js b/browser/extensions/formautofill/test/unit/test_addressComponent_city.js new file mode 100644 index 0000000000..8bb448cfe4 --- /dev/null +++ b/browser/extensions/formautofill/test/unit/test_addressComponent_city.js @@ -0,0 +1,27 @@ +"use strict"; + +const VALID_TESTS = [["New York City", true]]; + +const COMPARE_TESTS = [ + ["New York City", "New York City", SAME], + ["New York City", "new york city", SAME], + ["New York City", "New York City", SIMILAR], // Merge whitespace + ["Happy Valley-Goose Bay", "Happy Valley Goose Bay", SIMILAR], // Replace punctuation with whitespace + ["New York City", "New York", A_CONTAINS_B], + ["New York", "NewYork", DIFFERENT], + ["New York City", "City New York", DIFFERENT], +]; + +const TEST_FIELD_NAME = "City"; + +add_task(async function test_isValid() { + runIsValidTest(VALID_TESTS, TEST_FIELD_NAME, value => { + return { "address-level2": value }; + }); +}); + +add_task(async function test_compare() { + runCompareTest(COMPARE_TESTS, TEST_FIELD_NAME, value => { + return { "address-level2": value }; + }); +}); -- cgit v1.2.3