summaryrefslogtreecommitdiffstats
path: root/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_OfficeDepot.js
blob: 8c44104cb67a9379d2f039f46bb6df156104d720 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* global add_heuristic_tests */

"use strict";

add_heuristic_tests(
  [
    {
      fixturePath: "ShippingAddress.html",
      expectedResult: [
        {
          default: {
            reason: "regex-heuristic",
          },
          fields: [
            { fieldName: "given-name" },
            { fieldName: "family-name" },
            { fieldName: "organization" },
            { fieldName: "address-line1" },
            { fieldName: "address-line2" },
            { fieldName: "postal-code" },
            { fieldName: "address-level2" }, // City & State
            { fieldName: "address-level2" }, // City
            { fieldName: "address-level1" }, // State
            { fieldName: "tel-area-code" },
            { fieldName: "tel-local-prefix" },
            { fieldName: "tel-local-suffix" },
            { fieldName: "tel-extension" },
            { fieldName: "email" },
          ],
        },
      ],
    },
    {
      fixturePath: "Payment.html",
      expectedResult: [
        {
          invalid: true, // because non of them is identified by fathom
          default: {
            reason: "regex-heuristic",
          },
          fields: [
            { fieldName: "cc-exp-month" },
            { fieldName: "cc-exp-year" },
            { fieldName: "cc-number" },
          ],
        },
        {
          default: {
            reason: "regex-heuristic",
          },
          fields: [
            { fieldName: "given-name" },
            { fieldName: "family-name" },
            { fieldName: "organization" },
            { fieldName: "address-line1" },
            { fieldName: "address-line2" },
            { fieldName: "postal-code" },
            { fieldName: "address-level2" }, // City & State
            { fieldName: "address-level2" }, // City
            { fieldName: "address-level1" }, // state
            { fieldName: "tel-area-code" },
            { fieldName: "tel-local-prefix" },
            { fieldName: "tel-local-suffix" },
            { fieldName: "tel-extension" },
            { fieldName: "email" },
          ],
        },
      ],
    },
    {
      fixturePath: "SignIn.html",
      expectedResult: [
        {
          invalid: true,
          fields: [
            { fieldName: "email", reason: "regex-heuristic" },
          ],
        },
      ],
    },
  ],
  "fixtures/third_party/OfficeDepot/"
);