1
1
import { DEBUG } from '@glimmer/env' ;
2
2
import { moduleFor , RenderingTestCase , applyMixins , strip , runTask } from 'internal-test-helpers' ;
3
3
4
- import { isEmpty } from '@ember/utils' ;
5
4
import { action } from '@ember/object' ;
6
5
import { A as emberA } from '@ember/array' ;
7
6
@@ -956,35 +955,35 @@ moduleFor(
956
955
}
957
956
) ;
958
957
959
- assert . ok ( ! isEmpty ( instance ) , 'a instance was created' ) ;
958
+ assert . ok ( instance , 'the component instance exinstance was created' ) ;
960
959
assert . equal ( previousInstance , undefined , 'no previous component exists' ) ;
961
960
assert . equal ( initCount , 1 , 'the component was constructed exactly 1 time' ) ;
962
961
assert . equal ( this . $ ( ) . text ( ) , 'open' , 'the components text is "open"' ) ;
963
962
964
963
runTask ( ( ) => this . rerender ( ) ) ;
965
964
966
- assert . ok ( ! isEmpty ( instance ) , 'the component instance exists' ) ;
965
+ assert . ok ( instance , 'the component instance exists' ) ;
967
966
assert . equal ( previousInstance , undefined , 'no previous component exists' ) ;
968
967
assert . equal ( initCount , 1 , 'the component was constructed exactly 1 time' ) ;
969
968
assert . equal ( this . $ ( ) . text ( ) , 'open' , 'the components text is "open"' ) ;
970
969
971
970
runTask ( ( ) => this . context . set ( 'isOpen' , false ) ) ;
972
971
973
- assert . ok ( ! isEmpty ( instance ) , 'the component instance exists' ) ;
972
+ assert . ok ( instance , 'the component instance exists' ) ;
974
973
assert . equal ( previousInstance , undefined , 'no previous component exists' ) ;
975
974
assert . equal ( initCount , 1 , 'the component was constructed exactly 1 time' ) ;
976
975
assert . equal ( this . $ ( ) . text ( ) , 'closed' , 'the component text is "closed"' ) ;
977
976
978
977
runTask ( ( ) => this . rerender ( ) ) ;
979
978
980
- assert . ok ( ! isEmpty ( instance ) , 'the component instance exists' ) ;
979
+ assert . ok ( instance , 'the component instance exists' ) ;
981
980
assert . equal ( previousInstance , undefined , 'no previous component exists' ) ;
982
981
assert . equal ( initCount , 1 , 'the component was constructed exactly 1 time' ) ;
983
982
assert . equal ( this . $ ( ) . text ( ) , 'closed' , 'the component text is "closed"' ) ;
984
983
985
984
runTask ( ( ) => this . context . set ( 'isOpen' , true ) ) ;
986
985
987
- assert . ok ( ! isEmpty ( instance ) , 'the component instance exists' ) ;
986
+ assert . ok ( instance , 'the component instance exists' ) ;
988
987
assert . equal ( previousInstance , undefined , 'no previous component exists' ) ;
989
988
assert . equal ( initCount , 1 , 'the component was constructed exactly 1 time' ) ;
990
989
assert . equal ( this . $ ( ) . text ( ) , 'open' , 'the components text is "open"' ) ;
@@ -1021,35 +1020,35 @@ moduleFor(
1021
1020
}
1022
1021
) ;
1023
1022
1024
- assert . ok ( ! isEmpty ( instance ) , 'a instance was created' ) ;
1023
+ assert . ok ( instance , 'a instance was created' ) ;
1025
1024
assert . equal ( previousInstance , undefined , 'no previous component exists' ) ;
1026
1025
assert . equal ( initCount , 1 , 'the component was constructed exactly 1 time' ) ;
1027
1026
assert . equal ( this . $ ( ) . text ( ) , 'open' , 'the components text is "open"' ) ;
1028
1027
1029
1028
runTask ( ( ) => this . rerender ( ) ) ;
1030
1029
1031
- assert . ok ( ! isEmpty ( instance ) , 'the component instance exists' ) ;
1030
+ assert . ok ( instance , 'the component instance exists' ) ;
1032
1031
assert . equal ( previousInstance , undefined , 'no previous component exists' ) ;
1033
1032
assert . equal ( initCount , 1 , 'the component was constructed exactly 1 time' ) ;
1034
1033
assert . equal ( this . $ ( ) . text ( ) , 'open' , 'the components text is "open"' ) ;
1035
1034
1036
1035
runTask ( ( ) => this . context . set ( 'isOpen' , false ) ) ;
1037
1036
1038
- assert . ok ( ! isEmpty ( instance ) , 'the component instance exists' ) ;
1037
+ assert . ok ( instance , 'the component instance exists' ) ;
1039
1038
assert . equal ( previousInstance , undefined , 'no previous component exists' ) ;
1040
1039
assert . equal ( initCount , 1 , 'the component was constructed exactly 1 time' ) ;
1041
1040
assert . equal ( this . $ ( ) . text ( ) , 'closed' , 'the component text is "closed"' ) ;
1042
1041
1043
1042
runTask ( ( ) => this . rerender ( ) ) ;
1044
1043
1045
- assert . ok ( ! isEmpty ( instance ) , 'the component instance exists' ) ;
1044
+ assert . ok ( instance , 'the component instance exists' ) ;
1046
1045
assert . equal ( previousInstance , undefined , 'no previous component exists' ) ;
1047
1046
assert . equal ( initCount , 1 , 'the component was constructed exactly 1 time' ) ;
1048
1047
assert . equal ( this . $ ( ) . text ( ) , 'closed' , 'the component text is "closed"' ) ;
1049
1048
1050
1049
runTask ( ( ) => this . context . set ( 'isOpen' , true ) ) ;
1051
1050
1052
- assert . ok ( ! isEmpty ( instance ) , 'the component instance exists' ) ;
1051
+ assert . ok ( instance , 'the component instance exists' ) ;
1053
1052
assert . equal ( previousInstance , undefined , 'no previous component exists' ) ;
1054
1053
assert . equal ( initCount , 1 , 'the component was constructed exactly 1 time' ) ;
1055
1054
assert . equal ( this . $ ( ) . text ( ) , 'open' , 'the components text is "open"' ) ;
@@ -1099,22 +1098,22 @@ moduleFor(
1099
1098
}
1100
1099
) ;
1101
1100
1102
- assert . ok ( ! isEmpty ( instance ) , 'a instance was created' ) ;
1101
+ assert . ok ( instance , 'a instance was created' ) ;
1103
1102
assert . equal ( previousInstance , undefined , 'there is no previous instance' ) ;
1104
1103
assert . equal ( initCount , 1 , 'the component was constructed exactly 1 time' ) ;
1105
1104
assert . equal ( this . $ ( ) . text ( ) , 'my-comp: open' ) ;
1106
1105
1107
1106
runTask ( ( ) => this . rerender ( ) ) ;
1108
1107
1109
- assert . ok ( ! isEmpty ( instance ) , 'a instance exists after rerender' ) ;
1108
+ assert . ok ( instance , 'a instance exists after rerender' ) ;
1110
1109
assert . equal ( previousInstance , undefined , 'there is no previous instance after rerender' ) ;
1111
1110
assert . equal ( initCount , 1 , 'the component was constructed exactly 1 time' ) ;
1112
1111
assert . equal ( this . $ ( ) . text ( ) , 'my-comp: open' ) ;
1113
1112
1114
1113
runTask ( ( ) => this . context . set ( 'compName' , 'your-comp' ) ) ;
1115
1114
1116
- assert . ok ( ! isEmpty ( instance ) , 'an instance was created after component name changed' ) ;
1117
- assert . ok ( ! isEmpty ( previousInstance ) , 'a previous instance now exists' ) ;
1115
+ assert . ok ( instance , 'an instance was created after component name changed' ) ;
1116
+ assert . ok ( previousInstance , 'a previous instance now exists' ) ;
1118
1117
assert . notEqual (
1119
1118
instance ,
1120
1119
previousInstance ,
@@ -1125,11 +1124,8 @@ moduleFor(
1125
1124
1126
1125
runTask ( ( ) => this . rerender ( ) ) ;
1127
1126
1128
- assert . ok (
1129
- ! isEmpty ( instance ) ,
1130
- 'an instance was created after component name changed (rerender)'
1131
- ) ;
1132
- assert . ok ( ! isEmpty ( previousInstance ) , 'a previous instance now exists (rerender)' ) ;
1127
+ assert . ok ( instance , 'an instance was created after component name changed (rerender)' ) ;
1128
+ assert . ok ( previousInstance , 'a previous instance now exists (rerender)' ) ;
1133
1129
assert . notEqual (
1134
1130
instance ,
1135
1131
previousInstance ,
@@ -1140,8 +1136,8 @@ moduleFor(
1140
1136
1141
1137
runTask ( ( ) => this . context . set ( 'compName' , 'my-comp' ) ) ;
1142
1138
1143
- assert . ok ( ! isEmpty ( instance ) , 'an instance was created after component name changed' ) ;
1144
- assert . ok ( ! isEmpty ( previousInstance ) , 'a previous instance still exists' ) ;
1139
+ assert . ok ( instance , 'an instance was created after component name changed' ) ;
1140
+ assert . ok ( previousInstance , 'a previous instance still exists' ) ;
1145
1141
assert . notEqual (
1146
1142
instance ,
1147
1143
previousInstance ,
0 commit comments