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

Unified Diff: chrome/test/data/webui/md_user_manager/create_profile_tests.js

Issue 2223743003: MD User Manager: Changes to 'import supervised users' dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/md_user_manager/create_profile_tests.js
diff --git a/chrome/test/data/webui/md_user_manager/create_profile_tests.js b/chrome/test/data/webui/md_user_manager/create_profile_tests.js
index f4d34e17fdb7632fa40539f5e3f626432080642f..afb98789b4e9bbea8b29970a7a67df9a6e9ae532 100644
--- a/chrome/test/data/webui/md_user_manager/create_profile_tests.js
+++ b/chrome/test/data/webui/md_user_manager/create_profile_tests.js
@@ -183,6 +183,34 @@ cr.define('user_manager.create_profile_tests', function() {
});
});
+ test('Displays error if custodian has no supervised users', function() {
+ browserProxy.setExistingSupervisedUsers([]);
+
+ // Simulate checking the checkbox.
+ MockInteractions.tap(createProfileElement.$$('paper-checkbox'));
+ Polymer.dom.flush();
+
+ // Select the first signed in user.
+ var dropdownMenu = createProfileElement.$$('paper-dropdown-menu');
+ var selector = dropdownMenu.querySelector('paper-listbox');
+ selector.selected = 0;
+
+ // Simulate clicking 'Import supervised user'.
+ MockInteractions.tap(createProfileElement.$$('#import-user'));
+
+ return browserProxy.whenCalled('getExistingSupervisedUsers').then(
+ function(args) {
+ // Create is not in progress.
+ assertFalse(createProfileElement.createInProgress_);
+ // Message container is visible.
+ assertFalse(createProfileElement.$$('#message-container').hidden);
michaelpg 2016/08/09 02:53:48 nit: check foo.clientHeight > 0 instead of !foo.hi
Moe 2016/08/09 18:15:42 Done.
+ // Error message is set.
+ var message = loadTimeData.getString(
+ 'noSupervisedUserImportText');
+ assertEquals(message, createProfileElement.$.message.innerHTML);
+ });
+ });
+
test('Create supervised profile', function() {
// Simulate checking the checkbox.
MockInteractions.tap(createProfileElement.$$('paper-checkbox'));

Powered by Google App Engine
This is Rietveld 408576698