fix(testing): remove test zone for now and rely on returned promises
Adds tests for public Dart and TS frameworks to make sure that components with templateUrl can be created by the TestComponentBuilder. Closes #6359 Closes #6601
This commit is contained in:
@ -26,6 +26,13 @@ class TestService {
|
||||
}
|
||||
}
|
||||
|
||||
@Component(selector: 'external-template-cmp')
|
||||
@View(templateUrl: 'test_template.html')
|
||||
class ExternalTemplateComponent {
|
||||
ExternalTemplateComponent() {
|
||||
}
|
||||
}
|
||||
|
||||
class MyToken {}
|
||||
|
||||
const TEMPLATE =
|
||||
@ -79,6 +86,15 @@ void main() {
|
||||
expect(rootTC.debugElement.nativeElement.text, equals('1;2;3;'));
|
||||
});
|
||||
|
||||
ngTest('should allow a component using a templateUrl', (TestComponentBuilder tcb) async {
|
||||
var rootTC = await tcb
|
||||
.createAsync(ExternalTemplateComponent);
|
||||
|
||||
rootTC.detectChanges();
|
||||
|
||||
expect(rootTC.debugElement.nativeElement.text, equals('from external template\n'));
|
||||
});
|
||||
|
||||
group('expected failures', () {
|
||||
ngTest('no type in param list', (notTyped) {
|
||||
expect(1, equals(2));
|
||||
|
1
modules_dart/angular2_testing/test/test_template.html
Normal file
1
modules_dart/angular2_testing/test/test_template.html
Normal file
@ -0,0 +1 @@
|
||||
<span>from external template</span>
|
Reference in New Issue
Block a user