Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4534)

Unified Diff: chrome/test/data/webui/settings/settings_autofill_section_browsertest.js

Issue 2654553004: MD Settings: Update Autofill Credit Card Dialog to accept Enter Key (Closed)
Patch Set: update tests Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/settings_autofill_section_browsertest.js
diff --git a/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js b/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js
index ce09a25f63ca945253929ec485518ce634ee36ad..b3ba1065034821444a687a32ef4345b10dd56e53 100644
--- a/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js
+++ b/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js
@@ -303,7 +303,7 @@ TEST_F('SettingsAutofillSectionBrowserTest', 'CreditCardTests', function() {
});
});
- test('verifySaveExpiredCreditCardEdit', function(done) {
+ test('verify save disabled for expired credit card', function() {
var creditCard = FakeDataMaker.emptyCreditCardEntry();
var now = new Date();
@@ -315,29 +315,29 @@ TEST_F('SettingsAutofillSectionBrowserTest', 'CreditCardTests', function() {
return test_util.whenAttributeIs(
creditCardDialog.$.dialog, 'open', true).then(function() {
- creditCardDialog.addEventListener('save-credit-card', function() {
- // Fail the test because the save event should not be called when
- // the card is expired.
- assertTrue(false);
- });
- creditCardDialog.addEventListener('tap', function() {
- // Test is |done| in a timeout in order to ensure that
- // 'save-credit-card' is NOT fired after this test.
- assertFalse(creditCardDialog.$.expired.hidden);
- window.setTimeout(done, 100);
- });
- MockInteractions.tap(creditCardDialog.$.saveButton);
+ assertTrue(creditCardDialog.$.saveButton.disabled);
});
});
// Test will timeout if event is not received.
- test('verifySaveCreditCardEdit', function(done) {
+ test('verify save new credit card', function(done) {
var creditCard = FakeDataMaker.emptyCreditCardEntry();
var creditCardDialog = self.createCreditCardDialog_(creditCard);
return test_util.whenAttributeIs(
creditCardDialog.$.dialog, 'open', true).then(function() {
+ // Not expired, but still can't be saved, because there's no name.
assertTrue(creditCardDialog.$.expired.hidden);
+ assertTrue(creditCardDialog.$.saveButton.disabled);
+
+ // Add a name and trigger the on-input handler.
+ creditCardDialog.set('creditCard.name', 'Jane Doe');
+ creditCardDialog.onCreditCardNameOrNumberChanged_();
+ Polymer.dom.flush();
+
+ assertTrue(creditCardDialog.$.expired.hidden);
+ assertFalse(creditCardDialog.$.saveButton.disabled);
+
creditCardDialog.addEventListener('save-credit-card', function(event) {
assertEquals(creditCard.guid, event.detail.guid);
done();
« no previous file with comments | « chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698