2016-06-23 12:47:54 -04: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-11-10 21:13:11 -05:00
|
|
|
import {browser, by, element} from 'protractor';
|
2015-06-22 04:52:00 -04:00
|
|
|
|
2020-04-24 13:26:36 -04:00
|
|
|
import {verifyNoBrowserErrors} from '../../../e2e_util/e2e_util';
|
2019-02-01 08:46:38 -05:00
|
|
|
|
2015-06-22 04:52:00 -04:00
|
|
|
describe('Zippy Component', function() {
|
|
|
|
afterEach(verifyNoBrowserErrors);
|
|
|
|
|
2015-09-15 16:37:50 -04:00
|
|
|
describe('zippy', function() {
|
2019-02-01 08:46:38 -05:00
|
|
|
const URL = '/';
|
2015-06-22 04:52:00 -04:00
|
|
|
|
2020-04-13 19:40:21 -04:00
|
|
|
beforeEach(function() {
|
|
|
|
browser.get(URL);
|
|
|
|
});
|
2015-06-22 04:52:00 -04:00
|
|
|
|
|
|
|
it('should change the zippy title depending on it\'s state', function() {
|
2016-11-12 08:08:58 -05:00
|
|
|
const zippyTitle = element(by.css('.zippy__title'));
|
2015-06-22 04:52:00 -04: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);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|