diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /browser/extensions/formautofill/test/unit/test_addressComponent_city.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/extensions/formautofill/test/unit/test_addressComponent_city.js')
-rw-r--r-- | browser/extensions/formautofill/test/unit/test_addressComponent_city.js | 27 |
1 files changed, 27 insertions, 0 deletions
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 }; + }); +}); |