Chromium Code Reviews| 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')); |