| 
									
										
										
										
											2016-06-23 09:47:54 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							| 
									
										
										
										
											2020-05-19 12:08:49 -07:00
										 |  |  |  * Copyright Google LLC All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2016-06-23 09:47:54 -07:00
										 |  |  |  * | 
					
						
							|  |  |  |  * 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-11-10 18:13:11 -08:00
										 |  |  | import {browser, by, element} from 'protractor'; | 
					
						
							| 
									
										
										
										
											2015-06-22 10:52:00 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-24 13:14:28 -07:00
										 |  |  | import {verifyNoBrowserErrors} from '../../../../dev-infra/benchmark/driver-utilities'; | 
					
						
							| 
									
										
										
										
											2019-02-01 14:46:38 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											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() { | 
					
						
							| 
									
										
										
										
											2019-02-01 14:46:38 +01:00
										 |  |  |     const URL = '/'; | 
					
						
							| 
									
										
										
										
											2015-06-22 10:52:00 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-13 16:40:21 -07:00
										 |  |  |     beforeEach(function() { | 
					
						
							|  |  |  |       browser.get(URL); | 
					
						
							|  |  |  |     }); | 
					
						
							| 
									
										
										
										
											2015-06-22 10:52:00 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     it('should change the zippy title depending on it\'s state', function() { | 
					
						
							| 
									
										
										
										
											2016-11-12 14:08:58 +01:00
										 |  |  |       const zippyTitle = element(by.css('.zippy__title')); | 
					
						
							| 
									
										
										
										
											2015-06-22 10:52:00 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |       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); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | }); |