summaryrefslogtreecommitdiffstats
path: root/services/sync/tests/tps/test_creditcards.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /services/sync/tests/tps/test_creditcards.js
parentInitial commit. (diff)
downloadfirefox-upstream/124.0.1.tar.xz
firefox-upstream/124.0.1.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'services/sync/tests/tps/test_creditcards.js')
-rw-r--r--services/sync/tests/tps/test_creditcards.js62
1 files changed, 62 insertions, 0 deletions
diff --git a/services/sync/tests/tps/test_creditcards.js b/services/sync/tests/tps/test_creditcards.js
new file mode 100644
index 0000000000..fea2b8a541
--- /dev/null
+++ b/services/sync/tests/tps/test_creditcards.js
@@ -0,0 +1,62 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/* global Services */
+Services.prefs.setBoolPref("services.sync.engine.creditcards", true);
+
+EnableEngines(["creditcards"]);
+
+var phases = {
+ phase1: "profile1",
+ phase2: "profile2",
+ phase3: "profile1",
+};
+
+const cc1 = [
+ {
+ "cc-name": "John Doe",
+ "cc-number": "4716179744040592",
+ "cc-exp-month": 4,
+ "cc-exp-year": 2050,
+ "unknown-1": "an unknown field from another client",
+ changes: {
+ "cc-exp-year": 2051,
+ },
+ },
+];
+
+const cc1_after = [
+ {
+ "cc-name": "John Doe",
+ "cc-number": "4716179744040592",
+ "cc-exp-month": 4,
+ "cc-exp-year": 2051,
+ "unknown-1": "an unknown field from another client",
+ },
+];
+
+const cc2 = [
+ {
+ "cc-name": "Timothy Berners-Lee",
+ "cc-number": "2221000374457678",
+ "cc-exp-month": 12,
+ "cc-exp-year": 2050,
+ },
+];
+
+Phase("phase1", [[CreditCards.add, cc1], [Sync]]);
+
+Phase("phase2", [
+ [Sync],
+ [CreditCards.verify, cc1],
+ [CreditCards.modify, cc1],
+ [CreditCards.add, cc2],
+ [Sync],
+]);
+
+Phase("phase3", [
+ [Sync],
+ [CreditCards.verifyNot, cc1],
+ [CreditCards.verify, cc1_after],
+ [CreditCards.verify, cc2],
+]);