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

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

Issue 2441503002: [MD Settings][People] Visual updates to the sync setup page. (Closed)
Patch Set: Created 4 years, 2 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
Index: chrome/test/data/webui/settings/people_page_sync_page_test.js
diff --git a/chrome/test/data/webui/settings/people_page_sync_page_test.js b/chrome/test/data/webui/settings/people_page_sync_page_test.js
index fe8be556e735f9a144be7c80ccd3846bd6991f4f..4b06bc3123fdd742857de6e80f005ce65b1085d1 100644
--- a/chrome/test/data/webui/settings/people_page_sync_page_test.js
+++ b/chrome/test/data/webui/settings/people_page_sync_page_test.js
@@ -263,27 +263,27 @@ cr.define('settings_people_page_sync_page', function() {
assertTrue(encryptWithPassphrase.checked);
});
- test('CreatingPassphraseEmptyPassphrase', function() {
+ test('SaveButtonDisabledWhenPassphraseOrConfirmationEmpty', function() {
MockInteractions.tap(encryptWithPassphrase);
Polymer.dom.flush();
assertTrue(!!syncPage.$$('#create-password-box'));
var saveNewPassphrase = syncPage.$$('#saveNewPassphrase');
- assertTrue(!!saveNewPassphrase);
-
- MockInteractions.tap(saveNewPassphrase);
- Polymer.dom.flush();
-
var passphraseInput = syncPage.$$('#passphraseInput');
var passphraseConfirmationInput =
syncPage.$$('#passphraseConfirmationInput');
- assertTrue(!!passphraseInput);
- assertTrue(!!passphraseConfirmationInput);
- assertTrue(passphraseInput.invalid);
- assertFalse(passphraseConfirmationInput.invalid);
+ passphraseInput.value = '';
+ passphraseConfirmationInput.value = '';
+ assertTrue(!!saveNewPassphrase.disabled);
- assertFalse(syncPage.syncPrefs.encryptAllData);
+ passphraseInput.value = 'foo';
+ passphraseConfirmationInput.value = '';
+ assertTrue(!!saveNewPassphrase.disabled);
+
+ passphraseInput.value = 'foo';
+ passphraseConfirmationInput.value = 'bar';
+ assertFalse(!!saveNewPassphrase.disabled);
});
test('CreatingPassphraseMismatchedPassphrase', function() {
@@ -355,6 +355,24 @@ cr.define('settings_people_page_sync_page', function() {
assertTrue(syncPage.$.encryptionRadioGroupContainer.hidden);
});
+ test('ExistingPassphraseSubmitButtonHiddenIfPassphraseEmpty', function() {
tommycli 2016/10/25 18:28:46 The UI specs really call for the button to be HIDD
Moe 2016/10/25 22:30:18 The mocks seem to suggest that. I pinged Alan to k
tommycli 2016/10/25 22:39:09 Okay great. I leave it up to you if you want to ha
Moe 2016/10/26 18:26:13 Alan confirmed that the button should be disabled
+ var prefs = getSyncAllPrefs();
+ prefs.encryptAllData = true;
+ prefs.passphraseRequired = true;
+ cr.webUIListenerCallback('sync-prefs-changed', prefs);
+
+ Polymer.dom.flush();
+
+ var existingPassphraseInput = syncPage.$$('#existingPassphraseInput');
+ var submitExistingPassphrase = syncPage.$$('#submitExistingPassphrase');
+
+ existingPassphraseInput.value = '';
+ assertFalse(submitExistingPassphrase.clientHeight > 0);
+
+ existingPassphraseInput.value = 'foo';
+ assertTrue(submitExistingPassphrase.clientHeight > 0);
+ });
+
test('EnterExistingWrongPassphrase', function() {
var prefs = getSyncAllPrefs();
prefs.encryptAllData = true;

Powered by Google App Engine
This is Rietveld 408576698