OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** @fileoverview Suite of tests for issue-banner. */ | 5 /** @fileoverview Suite of tests for issue-banner. */ |
6 cr.define('issue_banner', function() { | 6 cr.define('issue_banner', function() { |
7 function registerTests() { | 7 function registerTests() { |
8 suite('IssueBanner', function() { | 8 suite('IssueBanner', function() { |
9 /** | 9 /** |
10 * Issue Banner created before each test. | 10 * Issue Banner created before each test. |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 banner.issue = fakeNonBlockingIssueOne; | 179 banner.issue = fakeNonBlockingIssueOne; |
180 checkIssueText(banner.issue); | 180 checkIssueText(banner.issue); |
181 }); | 181 }); |
182 | 182 |
183 // Tests whether parts of the issue-banner is hidden based on the | 183 // Tests whether parts of the issue-banner is hidden based on the |
184 // current state. | 184 // current state. |
185 test('hidden versus visible components', function() { | 185 test('hidden versus visible components', function() { |
186 // The blocking UI should be shown along with an optional action. | 186 // The blocking UI should be shown along with an optional action. |
187 banner.issue = fakeBlockingIssueOne; | 187 banner.issue = fakeBlockingIssueOne; |
188 checkButtonVisibility(fakeBlockingIssueOne.secondaryActionType); | 188 checkButtonVisibility(fakeBlockingIssueOne.secondaryActionType); |
189 assertFalse(banner.$['issue-header'].hasAttribute('hidden')); | |
190 | 189 |
191 // The blocking UI should be shown without an optional action. | 190 // The blocking UI should be shown without an optional action. |
192 banner.issue = fakeBlockingIssueTwo; | 191 banner.issue = fakeBlockingIssueTwo; |
193 checkButtonVisibility(fakeBlockingIssueTwo.secondaryActionType); | 192 checkButtonVisibility(fakeBlockingIssueTwo.secondaryActionType); |
194 assertFalse(banner.$['issue-header'].hasAttribute('hidden')); | |
195 | 193 |
196 // The non-blocking UI should be shown along with an optional action. | 194 // The non-blocking UI should be shown along with an optional action. |
197 banner.issue = fakeNonBlockingIssueOne; | 195 banner.issue = fakeNonBlockingIssueOne; |
198 checkButtonVisibility(fakeNonBlockingIssueOne.secondaryActionType); | 196 checkButtonVisibility(fakeNonBlockingIssueOne.secondaryActionType); |
199 assertTrue(banner.$['issue-header'].hasAttribute('hidden')); | |
200 | 197 |
201 // The non-blocking UI should be shown without an optional action. | 198 // The non-blocking UI should be shown without an optional action. |
202 banner.issue = fakeNonBlockingIssueTwo; | 199 banner.issue = fakeNonBlockingIssueTwo; |
203 checkButtonVisibility(fakeNonBlockingIssueTwo.secondaryActionType); | 200 checkButtonVisibility(fakeNonBlockingIssueTwo.secondaryActionType); |
204 assertTrue(banner.$['issue-header'].hasAttribute('hidden')); | |
205 }); | 201 }); |
206 }); | 202 }); |
207 } | 203 } |
208 | 204 |
209 return { | 205 return { |
210 registerTests: registerTests, | 206 registerTests: registerTests, |
211 }; | 207 }; |
212 }); | 208 }); |
OLD | NEW |