| 
									
										
										
										
											2016-06-23 09:47:54 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							|  |  |  |  * Copyright Google Inc. All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-01 22:54:19 -07:00
										 |  |  | import {verifyNoBrowserErrors} from '@angular/platform-browser/testing_e2e'; | 
					
						
							| 
									
										
										
										
											2015-06-22 10:52:00 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | describe('Zippy Component', function() { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   afterEach(verifyNoBrowserErrors); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-15 13:37:50 -07:00
										 |  |  |   describe('zippy', function() { | 
					
						
							| 
									
										
										
										
											2016-05-01 22:54:19 -07:00
										 |  |  |     var URL = 'all/playground/src/zippy_component/index.html'; | 
					
						
							| 
									
										
										
										
											2015-06-22 10:52:00 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     beforeEach(function() { browser.get(URL); }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('should change the zippy title depending on it\'s state', function() { | 
					
						
							|  |  |  |       var zippyTitle = element(by.css('.zippy__title')); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       expect(zippyTitle.getText()).toEqual('▾ Details'); | 
					
						
							|  |  |  |       zippyTitle.click(); | 
					
						
							|  |  |  |       expect(zippyTitle.getText()).toEqual('▸ Details'); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('should have zippy content', function() { | 
					
						
							|  |  |  |       expect(element(by.css('.zippy__content')).getText()).toEqual('This is some content.'); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('should toggle when the zippy title is clicked', function() { | 
					
						
							|  |  |  |       element(by.css('.zippy__title')).click(); | 
					
						
							|  |  |  |       expect(element(by.css('.zippy__content')).isDisplayed()).toEqual(false); | 
					
						
							|  |  |  |       element(by.css('.zippy__title')).click(); | 
					
						
							|  |  |  |       expect(element(by.css('.zippy__content')).isDisplayed()).toEqual(true); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | }); |