@@ -12,7 +12,7 @@ import {registerElement} from 'nativescript-angular/element-registry';
1212import * as button from 'tns-core-modules/ui/button' ;
1313import * as view from 'tns-core-modules/ui/core/view' ;
1414import { nTestBedAfterEach , nTestBedBeforeEach , nTestBedRender } from 'nativescript-angular/testing' ;
15- import { ComponentFixture } from '@angular/core/testing' ;
15+ import { ComponentFixture , TestBed } from '@angular/core/testing' ;
1616
1717@Component ( {
1818 template : `<StackLayout><Label text="Layout"></Label></StackLayout>`
@@ -243,7 +243,7 @@ export class NgForLabel {
243243 }
244244}
245245
246- xdescribe ( "Renderer E2E" , ( ) => {
246+ describe ( "Renderer E2E" , ( ) => {
247247 beforeEach ( nTestBedBeforeEach ( [
248248 LayoutWithLabel , LabelCmp , LabelContainer ,
249249 ProjectableCmp , ProjectionContainer ,
@@ -315,7 +315,7 @@ xdescribe("Renderer E2E", () => {
315315 done ( ) ;
316316 } ;
317317
318- return nTestBedRender ( ZonedRenderer ) . then ( ( fixture : ComponentFixture < ZonedRenderer > ) => {
318+ nTestBedRender ( ZonedRenderer ) . then ( ( fixture : ComponentFixture < ZonedRenderer > ) => {
319319 fixture . ngZone . run ( ( ) => {
320320 fixture . componentInstance . renderer . listen ( view , eventName , callback ) ;
321321 } ) ;
@@ -338,7 +338,7 @@ xdescribe("Renderer E2E", () => {
338338 assert . isTrue ( NgZone . isInAngularZone ( ) , "Event should be executed inside NgZone" ) ;
339339 done ( ) ;
340340 } ;
341- return nTestBedRender ( ZonedRenderer ) . then ( ( fixture : ComponentFixture < ZonedRenderer > ) => {
341+ nTestBedRender ( ZonedRenderer ) . then ( ( fixture : ComponentFixture < ZonedRenderer > ) => {
342342 fixture . ngZone . runOutsideAngular ( ( ) => {
343343 fixture . componentInstance . renderer . listen ( view , eventName , callback ) ;
344344
@@ -609,6 +609,7 @@ describe("Renderer attach/detach", () => {
609609 } ) ;
610610} ) ;
611611
612+ // TODO: I'm not sure about this lifecycle test.
612613xdescribe ( "Renderer lifecycle" , ( ) => {
613614 let renderer : Renderer2 = null ;
614615 beforeEach ( nTestBedBeforeEach ( [ ZonedRenderer , NgControlSettersCount ] ) ) ;
@@ -622,17 +623,17 @@ xdescribe("Renderer lifecycle", () => {
622623 } ) ;
623624
624625 it ( "view native setters are called once on startup" , ( ) => {
625- return nTestBedRender ( NgControlSettersCount ) . then ( ( fixture ) => {
626- const componentRef : ComponentRef < NgControlSettersCount > = fixture . componentRef ;
627- assert . isTrue ( componentRef . instance . isAfterViewInit , "Expected the NgControlSettersCount to have passed its ngAfterViewInit." ) ;
628- componentRef . instance . buttons . map ( btn => btn . nativeElement ) . forEach ( btn => {
629- assert . isTrue ( btn . isLoaded , `Expected ${ btn . id } to be allready loaded.` ) ;
630- assert . isFalse ( btn . isLayoutValid , `Expected ${ btn . id } 's layout to be invalid .` ) ;
631-
632- assert . equal ( btn . backgroundInternalSetNativeCount , 1 , `Expected ${ btn . id } backgroundInternalSetNativeCount to be called just once.` ) ;
633- assert . equal ( btn . fontInternalSetNativeCount , 1 , `Expected ${ btn . id } fontInternalSetNativeCount to be called just once.` ) ;
634- assert . equal ( btn . nativeBackgroundRedraws , 0 , `Expected ${ btn . id } nativeBackgroundRedraws to be called after its layout pass .` ) ;
635- } ) ;
626+ const fixture = TestBed . createComponent ( NgControlSettersCount ) ;
627+ fixture . detectChanges ( ) ;
628+ const componentRef : ComponentRef < NgControlSettersCount > = fixture . componentRef ;
629+ assert . isTrue ( componentRef . instance . isAfterViewInit , "Expected the NgControlSettersCount to have passed its ngAfterViewInit." ) ;
630+ componentRef . instance . buttons . map ( btn => btn . nativeElement ) . forEach ( btn => {
631+ assert . isTrue ( btn . isLoaded , `Expected ${ btn . id } to be allready loaded .` ) ;
632+ assert . isFalse ( btn . isLayoutValid , `Expected ${ btn . id } 's layout to be invalid.` ) ;
633+
634+ assert . equal ( btn . backgroundInternalSetNativeCount , 1 , `Expected ${ btn . id } backgroundInternalSetNativeCount to be called just once.` ) ;
635+ assert . equal ( btn . fontInternalSetNativeCount , 1 , `Expected ${ btn . id } fontInternalSetNativeCount to be called just once .` ) ;
636+ assert . equal ( btn . nativeBackgroundRedraws , 0 , `Expected ${ btn . id } nativeBackgroundRedraws to be called after its layout pass.` ) ;
636637 } ) ;
637638 } ) ;
638639} ) ;
0 commit comments