| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 cr.define('user_manager.create_profile_tests', function() { | 5 cr.define('user_manager.create_profile_tests', function() { |
| 6 /** @return {!CreateProfileElement} */ | 6 /** @return {!CreateProfileElement} */ |
| 7 function createElement() { | 7 function createElement() { |
| 8 PolymerTest.clearBody(); | 8 PolymerTest.clearBody(); |
| 9 var createProfileElement = document.createElement('create-profile'); | 9 var createProfileElement = document.createElement('create-profile'); |
| 10 document.body.appendChild(createProfileElement); | 10 document.body.appendChild(createProfileElement); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 test('Sentinel item is the initially selected item', function() { | 77 test('Sentinel item is the initially selected item', function() { |
| 78 return browserProxy.whenCalled('getSignedInUsers').then(function() { | 78 return browserProxy.whenCalled('getSignedInUsers').then(function() { |
| 79 // Simulate checking the checkbox. | 79 // Simulate checking the checkbox. |
| 80 MockInteractions.tap(createProfileElement.$$('paper-checkbox')); | 80 MockInteractions.tap(createProfileElement.$$('paper-checkbox')); |
| 81 Polymer.dom.flush(); | 81 Polymer.dom.flush(); |
| 82 | 82 |
| 83 var dropdownMenu = createProfileElement.$$('paper-dropdown-menu'); | 83 var dropdownMenu = createProfileElement.$$('paper-dropdown-menu'); |
| 84 var paperMenu = dropdownMenu.querySelector('paper-menu'); | 84 var paperMenu = dropdownMenu.querySelector('paper-menu'); |
| 85 assertEquals(createProfileElement.i18n('selectAnAccount'), | 85 assertEquals(createProfileElement.i18n('selectAnAccount'), |
| 86 paperMenu.selectedItem.textContent.trim()); | 86 [paperMenu.selectedItem.textContent.trim()]); |
| 87 }); | 87 }); |
| 88 }); | 88 }); |
| 89 | 89 |
| 90 test('Name is non-empty by default', function() { | 90 test('Name is non-empty by default', function() { |
| 91 assertEquals('profile name', createProfileElement.$.nameInput.value); | 91 assertEquals('profile name', createProfileElement.$.nameInput.value); |
| 92 }); | 92 }); |
| 93 | 93 |
| 94 test('Create button is disabled if name is empty or invalid', function() { | 94 test('Create button is disabled if name is empty or invalid', function() { |
| 95 assertEquals('profile name', createProfileElement.$.nameInput.value); | 95 assertEquals('profile name', createProfileElement.$.nameInput.value); |
| 96 assertFalse(createProfileElement.$.nameInput.invalid); | 96 assertFalse(createProfileElement.$.nameInput.invalid); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 test('Create button is disabled', function() { | 387 test('Create button is disabled', function() { |
| 388 assertTrue(createProfileElement.$.save.disabled); | 388 assertTrue(createProfileElement.$.save.disabled); |
| 389 }); | 389 }); |
| 390 }); | 390 }); |
| 391 } | 391 } |
| 392 | 392 |
| 393 return { | 393 return { |
| 394 registerTests: registerTests, | 394 registerTests: registerTests, |
| 395 }; | 395 }; |
| 396 }); | 396 }); |
| OLD | NEW |