@@ -1104,77 +1104,70 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
1104
1104
} ) ;
1105
1105
1106
1106
describe ( 'ngOnDestroy' , ( ) => {
1107
- fixmeIvy ( 'FW-763: LView tree not properly constructed / destroyed' )
1108
- . it ( 'should be called on view destruction' , fakeAsync ( ( ) => {
1109
- const ctx = createCompFixture ( '<div testDirective="dir"></div>' ) ;
1110
- ctx . detectChanges ( false ) ;
1107
+ it ( 'should be called on view destruction' , fakeAsync ( ( ) => {
1108
+ const ctx = createCompFixture ( '<div testDirective="dir"></div>' ) ;
1109
+ ctx . detectChanges ( false ) ;
1111
1110
1112
- ctx . destroy ( ) ;
1111
+ ctx . destroy ( ) ;
1113
1112
1114
- expect ( directiveLog . filter ( [ 'ngOnDestroy' ] ) ) . toEqual ( [ 'dir.ngOnDestroy' ] ) ;
1115
- } ) ) ;
1113
+ expect ( directiveLog . filter ( [ 'ngOnDestroy' ] ) ) . toEqual ( [ 'dir.ngOnDestroy' ] ) ;
1114
+ } ) ) ;
1116
1115
1117
- fixmeIvy ( 'FW-763: LView tree not properly constructed / destroyed' )
1118
- . it ( 'should be called after processing the content and view children' , fakeAsync ( ( ) => {
1119
- TestBed . overrideComponent ( AnotherComponent , {
1120
- set : new Component ( {
1121
- selector : 'other-cmp' ,
1122
- template : '<div testDirective="viewChild"></div>'
1123
- } )
1124
- } ) ;
1116
+ it ( 'should be called after processing the content and view children' , fakeAsync ( ( ) => {
1117
+ TestBed . overrideComponent ( AnotherComponent , {
1118
+ set : new Component (
1119
+ { selector : 'other-cmp' , template : '<div testDirective="viewChild"></div>' } )
1120
+ } ) ;
1125
1121
1126
- const ctx = createCompFixture (
1127
- '<div testDirective="parent"><div *ngFor="let x of [0,1]" testDirective="contentChild{{x}}"></div>' +
1128
- '<other-cmp></other-cmp></div>' ,
1129
- TestComponent ) ;
1122
+ const ctx = createCompFixture (
1123
+ '<div testDirective="parent"><div *ngFor="let x of [0,1]" testDirective="contentChild{{x}}"></div>' +
1124
+ '<other-cmp></other-cmp></div>' ,
1125
+ TestComponent ) ;
1130
1126
1131
- ctx . detectChanges ( false ) ;
1132
- ctx . destroy ( ) ;
1127
+ ctx . detectChanges ( false ) ;
1128
+ ctx . destroy ( ) ;
1133
1129
1134
- expect ( directiveLog . filter ( [ 'ngOnDestroy' ] ) ) . toEqual ( [
1135
- 'contentChild0.ngOnDestroy' , 'contentChild1.ngOnDestroy' ,
1136
- 'viewChild.ngOnDestroy' , 'parent.ngOnDestroy'
1137
- ] ) ;
1138
- } ) ) ;
1130
+ expect ( directiveLog . filter ( [ 'ngOnDestroy' ] ) ) . toEqual ( [
1131
+ 'contentChild0.ngOnDestroy' , 'contentChild1.ngOnDestroy' , 'viewChild .ngOnDestroy',
1132
+ 'parent.ngOnDestroy'
1133
+ ] ) ;
1134
+ } ) ) ;
1139
1135
1140
- fixmeIvy ( 'FW-763: LView tree not properly constructed / destroyed' )
1141
- . it ( 'should be called in reverse order so the child is always notified before the parent' ,
1142
- fakeAsync ( ( ) => {
1143
- const ctx = createCompFixture (
1144
- '<div testDirective="parent"><div testDirective="child"></div></div><div testDirective="sibling"></div>' ) ;
1136
+ it ( 'should be called in reverse order so the child is always notified before the parent' ,
1137
+ fakeAsync ( ( ) => {
1138
+ const ctx = createCompFixture (
1139
+ '<div testDirective="parent"><div testDirective="child"></div></div><div testDirective="sibling"></div>' ) ;
1145
1140
1146
- ctx . detectChanges ( false ) ;
1147
- ctx . destroy ( ) ;
1141
+ ctx . detectChanges ( false ) ;
1142
+ ctx . destroy ( ) ;
1148
1143
1149
- expect ( directiveLog . filter ( [ 'ngOnDestroy' ] ) ) . toEqual ( [
1150
- 'child.ngOnDestroy' , 'parent.ngOnDestroy' , 'sibling.ngOnDestroy'
1151
- ] ) ;
1152
- } ) ) ;
1144
+ expect ( directiveLog . filter ( [ 'ngOnDestroy' ] ) ) . toEqual ( [
1145
+ 'child.ngOnDestroy' , 'parent.ngOnDestroy' , 'sibling.ngOnDestroy'
1146
+ ] ) ;
1147
+ } ) ) ;
1153
1148
1154
- fixmeIvy ( 'FW-763: LView tree not properly constructed / destroyed' )
1155
- . it ( 'should deliver synchronous events to parent' , fakeAsync ( ( ) => {
1156
- const ctx =
1157
- createCompFixture ( '<div (destroy)="a=$event" onDestroyDirective></div>' ) ;
1149
+ it ( 'should deliver synchronous events to parent' , fakeAsync ( ( ) => {
1150
+ const ctx = createCompFixture ( '<div (destroy)="a=$event" onDestroyDirective></div>' ) ;
1158
1151
1159
- ctx . detectChanges ( false ) ;
1160
- ctx . destroy ( ) ;
1152
+ ctx . detectChanges ( false ) ;
1153
+ ctx . destroy ( ) ;
1161
1154
1162
- expect ( ctx . componentInstance . a ) . toEqual ( 'destroyed' ) ;
1163
- } ) ) ;
1155
+ expect ( ctx . componentInstance . a ) . toEqual ( 'destroyed' ) ;
1156
+ } ) ) ;
1164
1157
1165
- fixmeIvy ( 'FW-763: LView tree not properly constructed / destroyed' )
1166
- . it ( 'should call ngOnDestroy on pipes' , fakeAsync ( ( ) => {
1167
- const ctx = createCompFixture ( '{{true | pipeWithOnDestroy }}' ) ;
1168
1158
1169
- ctx . detectChanges ( false ) ;
1170
- ctx . destroy ( ) ;
1159
+ it ( 'should call ngOnDestroy on pipes' , fakeAsync ( ( ) => {
1160
+ const ctx = createCompFixture ( '{{true | pipeWithOnDestroy }}' ) ;
1171
1161
1172
- expect ( directiveLog . filter ( [ 'ngOnDestroy' ] ) ) . toEqual ( [
1173
- 'pipeWithOnDestroy.ngOnDestroy'
1174
- ] ) ;
1175
- } ) ) ;
1162
+ ctx . detectChanges ( false ) ;
1163
+ ctx . destroy ( ) ;
1164
+
1165
+ expect ( directiveLog . filter ( [ 'ngOnDestroy' ] ) ) . toEqual ( [
1166
+ 'pipeWithOnDestroy.ngOnDestroy'
1167
+ ] ) ;
1168
+ } ) ) ;
1176
1169
1177
- fixmeIvy ( 'FW-763: LView tree not properly constructed / destroyed ' )
1170
+ fixmeIvy ( 'FW-848: ngOnDestroy hooks are not called on providers ' )
1178
1171
. it ( 'should call ngOnDestroy on an injectable class' , fakeAsync ( ( ) => {
1179
1172
TestBed . overrideDirective (
1180
1173
TestDirective , { set : { providers : [ InjectableWithLifecycle ] } } ) ;
0 commit comments