summaryrefslogtreecommitdiffstats
path: root/browser/extensions/formautofill/test/mochitest/creditCard
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /browser/extensions/formautofill/test/mochitest/creditCard
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/extensions/formautofill/test/mochitest/creditCard')
-rw-r--r--browser/extensions/formautofill/test/mochitest/creditCard/test_basic_creditcard_autocomplete_form.html31
-rw-r--r--browser/extensions/formautofill/test/mochitest/creditCard/test_creditcard_autocomplete_off.html9
2 files changed, 25 insertions, 15 deletions
diff --git a/browser/extensions/formautofill/test/mochitest/creditCard/test_basic_creditcard_autocomplete_form.html b/browser/extensions/formautofill/test/mochitest/creditCard/test_basic_creditcard_autocomplete_form.html
index 8d1333b727..717d40946f 100644
--- a/browser/extensions/formautofill/test/mochitest/creditCard/test_basic_creditcard_autocomplete_form.html
+++ b/browser/extensions/formautofill/test/mochitest/creditCard/test_basic_creditcard_autocomplete_form.html
@@ -59,6 +59,11 @@ async function setupFormHistory() {
]);
}
+function replaceStars(str)
+{
+ return str.replaceAll("*", "•")
+}
+
initPopupListener();
// Form with history only.
@@ -86,7 +91,7 @@ add_task(async function all_saved_fields_less_than_threshold() {
synthesizeKey("KEY_ArrowDown");
checkMenuEntries([reducedMockRecord].map(patchRecordCCNumber).map(({ cc, expected }) => JSON.stringify({
primary: cc["cc-name"],
- secondary: cc.ccNumberFmt,
+ secondary: replaceStars(cc.ccNumberFmt),
ariaLabel: `Visa ${cc["cc-name"]} ${cc.ccNumberFmt}`,
image: expected.image,
})));
@@ -102,8 +107,8 @@ add_task(async function check_menu_when_both_existed() {
await expectPopup();
synthesizeKey("KEY_ArrowDown");
checkMenuEntries(MOCK_STORAGE.map(patchRecordCCNumber).map(({ cc, expected }) => JSON.stringify({
- primary: cc.ccNumberFmt,
- secondary: cc["cc-name"],
+ primary: replaceStars(cc.ccNumberFmt),
+ secondary: cc["cc-name"].toString(),
ariaLabel: `${getCCTypeName(cc)} ${cc.ccNumberFmt.replaceAll("*", "")} ${cc["cc-name"]}`,
image: expected.image,
})));
@@ -112,8 +117,8 @@ add_task(async function check_menu_when_both_existed() {
await expectPopup();
synthesizeKey("KEY_ArrowDown");
checkMenuEntries(MOCK_STORAGE.map(patchRecordCCNumber).map(({ cc, expected }) => JSON.stringify({
- primary: cc["cc-name"],
- secondary: cc.ccNumberFmt,
+ primary: cc["cc-name"].toString(),
+ secondary: replaceStars(cc.ccNumberFmt),
ariaLabel: `${getCCTypeName(cc)} ${cc["cc-name"]} ${cc.ccNumberFmt}`,
image: expected.image,
})));
@@ -122,8 +127,8 @@ add_task(async function check_menu_when_both_existed() {
await expectPopup();
synthesizeKey("KEY_ArrowDown");
checkMenuEntries(MOCK_STORAGE.map(patchRecordCCNumber).map(({ cc, expected }) => JSON.stringify({
- primary: cc["cc-exp-year"],
- secondary: cc.ccNumberFmt,
+ primary: cc["cc-exp-year"].toString(),
+ secondary: replaceStars(cc.ccNumberFmt),
ariaLabel: `${getCCTypeName(cc)} ${cc["cc-exp-year"]} ${cc.ccNumberFmt}`,
image: expected.image,
})));
@@ -132,8 +137,8 @@ add_task(async function check_menu_when_both_existed() {
await expectPopup();
synthesizeKey("KEY_ArrowDown");
checkMenuEntries(MOCK_STORAGE.map(patchRecordCCNumber).map(({ cc, expected }) => JSON.stringify({
- primary: cc["cc-exp-month"],
- secondary: cc.ccNumberFmt,
+ primary: cc["cc-exp-month"].toString(),
+ secondary: replaceStars(cc.ccNumberFmt),
ariaLabel: `${getCCTypeName(cc)} ${cc["cc-exp-month"]} ${cc.ccNumberFmt}`,
image: expected.image,
})));
@@ -185,8 +190,8 @@ add_task(async function check_fields_after_form_autofill() {
// The popup doesn't auto-show on focus because the field isn't empty
await expectPopup();
checkMenuEntries(MOCK_STORAGE.slice(1).map(patchRecordCCNumber).map(({ cc, expected }) => JSON.stringify({
- primary: cc["cc-exp-year"],
- secondary: cc.ccNumberFmt,
+ primary: cc["cc-exp-year"].toString(),
+ secondary: replaceStars(cc.ccNumberFmt),
ariaLabel: `${getCCTypeName(cc)} ${cc["cc-exp-year"]} ${cc.ccNumberFmt}`,
image: expected.image,
})));
@@ -220,7 +225,7 @@ add_task(async function check_cc_popup_on_field_blank() {
await expectPopup();
checkMenuEntries(MOCK_STORAGE.map(patchRecordCCNumber).map(({ cc, expected }) => JSON.stringify({
primary: cc["cc-name"],
- secondary: cc.ccNumberFmt,
+ secondary: replaceStars(cc.ccNumberFmt),
ariaLabel: `${getCCTypeName(cc)} ${cc["cc-name"]} ${cc.ccNumberFmt}`,
image: expected.image,
})));
@@ -240,7 +245,7 @@ add_task(async function check_form_autofill_resume() {
await expectPopup();
checkMenuEntries(MOCK_STORAGE.map(patchRecordCCNumber).map(({ cc, expected }) => JSON.stringify({
primary: cc["cc-name"],
- secondary: cc.ccNumberFmt,
+ secondary: replaceStars(cc.ccNumberFmt),
ariaLabel: `${getCCTypeName(cc)} ${cc["cc-name"]} ${cc.ccNumberFmt}`,
image: expected.image,
})));
diff --git a/browser/extensions/formautofill/test/mochitest/creditCard/test_creditcard_autocomplete_off.html b/browser/extensions/formautofill/test/mochitest/creditCard/test_creditcard_autocomplete_off.html
index 04ff6ff85c..c42a1ad2d0 100644
--- a/browser/extensions/formautofill/test/mochitest/creditCard/test_creditcard_autocomplete_off.html
+++ b/browser/extensions/formautofill/test/mochitest/creditCard/test_creditcard_autocomplete_off.html
@@ -49,6 +49,11 @@ async function setupFormHistory() {
]);
}
+function replaceStars(str)
+{
+ return str.replaceAll("*", "•")
+}
+
initPopupListener();
// Show Form History popup for non-autocomplete="off" field only
@@ -73,7 +78,7 @@ add_task(async function check_menu_when_both_with_autocomplete_off() {
synthesizeKey("KEY_ArrowDown");
await expectPopup();
checkMenuEntries(MOCK_STORAGE.map(patchRecordCCNumber).map(({ cc, expected }) => JSON.stringify({
- primary: cc.ccNumberFmt,
+ primary: replaceStars(cc.ccNumberFmt),
secondary: cc["cc-name"],
ariaLabel: `${getCCTypeName(cc)} ${cc.ccNumberFmt.replaceAll("*", "")} ${cc["cc-name"]}`,
image: expected.image,
@@ -84,7 +89,7 @@ add_task(async function check_menu_when_both_with_autocomplete_off() {
await expectPopup();
checkMenuEntries(MOCK_STORAGE.map(patchRecordCCNumber).map(({ cc, expected }) => JSON.stringify({
primary: cc["cc-name"],
- secondary: cc.ccNumberFmt,
+ secondary: replaceStars(cc.ccNumberFmt),
ariaLabel: `${getCCTypeName(cc)} ${cc["cc-name"]} ${cc.ccNumberFmt}`,
image: expected.image,
})));