Bug 1451143 - Check that the card is updated before proceeding with test. r=MattN
authorJared Wein <jwein@mozilla.com>
Wed, 02 May 2018 09:55:20 -0400
changeset 472827 18718bb58de42a44f461e41e1d8fe7922d83f68d
parent 472819 a0f7e5f1bea6466277ba96a2bd22eee6f72930c3
child 472828 aa5c4afe0acb45067fe6985bd94f407138f323e0
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1451143
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1451143 - Check that the card is updated before proceeding with test. r=MattN MozReview-Commit-ID: Kh7I9Jc0uQV
browser/components/payments/test/browser/browser_card_edit.js
--- a/browser/components/payments/test/browser/browser_card_edit.js
+++ b/browser/components/payments/test/browser/browser_card_edit.js
@@ -100,18 +100,20 @@ add_task(async function test_edit_link()
       field.value = val;
       ok(!field.disabled, `Field #${key} shouldn't be disabled`);
     }
     ok(content.document.getElementById("cc-number").disabled, "cc-number field should be disabled");
 
     content.document.querySelector("basic-card-form button:last-of-type").click();
 
     state = await PTU.DialogContentUtils.waitForState(content, (state) => {
-      return Object.keys(state.savedBasicCards).length == 1;
-    }, "Check card was added");
+      let cards = Object.entries(state.savedBasicCards);
+      return cards.length == 1 &&
+             cards[0][1]["cc-name"] == card["cc-name"];
+    }, "Check card was edited");
 
     let cardGUIDs = Object.keys(state.savedBasicCards);
     is(cardGUIDs.length, 1, "Check there is still one card");
     let savedCard = state.savedBasicCards[cardGUIDs[0]];
     is(savedCard["cc-number"], "************1111", "Card number should be masked and unmodified.");
     for (let [key, val] of Object.entries(card)) {
       is(savedCard[key], val, "Check updated " + key);
     }