test: closure integration test for change detection (#14691)

This commit is contained in:
Alex Eagle 2017-03-01 08:05:22 -08:00 committed by Igor Minar
parent 5753de50f0
commit 49b462e815
2 changed files with 9 additions and 4 deletions

View File

@ -3,6 +3,9 @@ import { browser, element, by } from 'protractor';
describe('Hello world E2E Tests', function () {
it('should display: Hello world!', function () {
browser.get('');
expect(element(by.css('div')).getText()).toEqual('Hello world!');
const div = element(by.css('div'));
expect(div.getText()).toEqual('Hello world!');
element(by.css('input')).sendKeys('!');
expect(div.getText()).toEqual('Hello world!!');
});
});

View File

@ -1,10 +1,12 @@
import {Component, Injectable} from '@angular/core';
import {Component} from '@angular/core';
@Component({
selector: 'hello-world-app',
template: '<div>Hello {{ name }}!</div>',
template: `
<div>Hello {{ name }}!</div>
<input type="text" [value]="name" (input)="name = $event.target.value"/>
`,
})
@Injectable()
export class HelloWorldComponent {
name: string = 'world';
}