fix(build): test example directories with unit and e2e tests (#11296)
This commit is contained in:

committed by
Evan Martin

parent
567900e550
commit
ed2ebeb52a
@ -7,10 +7,11 @@
|
||||
*/
|
||||
|
||||
// #docregion Component
|
||||
import {Component, animate, state, style, transition, trigger} from '@angular/core';
|
||||
import {Component, NgModule, animate, state, style, transition, trigger} from '@angular/core';
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
|
||||
@Component({
|
||||
selector: 'my-expando',
|
||||
selector: 'example-app',
|
||||
styles: [`
|
||||
.toggle-container {
|
||||
background-color:white;
|
||||
@ -46,4 +47,9 @@ export class MyExpandoCmp {
|
||||
expand() { this.stateExpression = 'expanded'; }
|
||||
collapse() { this.stateExpression = 'collapsed'; }
|
||||
}
|
||||
|
||||
@NgModule({imports: [BrowserModule], declarations: [MyExpandoCmp], bootstrap: [MyExpandoCmp]})
|
||||
export class AppModule {
|
||||
}
|
||||
|
||||
// #enddocregion
|
||||
|
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
|
||||
import {verifyNoBrowserErrors} from '../../../../../_common/e2e_util';
|
||||
|
||||
function waitForElement(selector: string) {
|
||||
var EC = (<any>protractor).ExpectedConditions;
|
||||
// Waits for the element with id 'abc' to be present on the dom.
|
||||
browser.wait(EC.presenceOf($(selector)), 20000);
|
||||
}
|
||||
|
||||
describe('animation example', () => {
|
||||
afterEach(verifyNoBrowserErrors);
|
||||
|
||||
describe('index view', () => {
|
||||
var URL = '/core/animation/ts/dsl/index.html';
|
||||
|
||||
it('should list out the current collection of items', () => {
|
||||
browser.get(URL);
|
||||
waitForElement('.toggle-container');
|
||||
expect(element.all(by.css('.toggle-container')).get(0).getText()).toEqual('Look at this box');
|
||||
});
|
||||
});
|
||||
});
|
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
export {AppModule} from './animation_example';
|
Reference in New Issue
Block a user