File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -1015,19 +1015,28 @@ test("Watch as array with more then one value", t => {
1015
1015
} )
1016
1016
1017
1017
test ( "$asyncComputed[name].state resolves to 'success' even if the computed value is 0 (issue #75)" , t => {
1018
- t . plan ( 11 )
1018
+ t . plan ( 13 )
1019
1019
const vm = new Vue ( {
1020
+ computed : {
1021
+ isUpdating ( ) {
1022
+ return this . $asyncComputed . a . updating
1023
+ }
1024
+ } ,
1020
1025
asyncComputed : {
1021
- a ( ) {
1022
- return Promise . resolve ( 0 )
1023
- } ,
1026
+ a : {
1027
+ async get ( ) {
1028
+ return 0
1029
+ } ,
1030
+ default : null
1031
+ }
1024
1032
}
1025
1033
} )
1026
1034
t . equal ( vm . $asyncComputed [ 'a' ] . state , 'updating' )
1027
1035
t . equal ( vm . $asyncComputed [ 'a' ] . updating , true )
1028
1036
t . equal ( vm . $asyncComputed [ 'a' ] . success , false )
1029
1037
t . equal ( vm . $asyncComputed [ 'a' ] . error , false )
1030
1038
t . equal ( vm . $asyncComputed [ 'a' ] . exception , null )
1039
+ t . equal ( vm . isUpdating , true )
1031
1040
1032
1041
Vue . nextTick ( ( ) => {
1033
1042
t . equal ( vm . a , 0 )
@@ -1036,5 +1045,6 @@ test("$asyncComputed[name].state resolves to 'success' even if the computed valu
1036
1045
t . equal ( vm . $asyncComputed [ 'a' ] . success , true )
1037
1046
t . equal ( vm . $asyncComputed [ 'a' ] . error , false )
1038
1047
t . equal ( vm . $asyncComputed [ 'a' ] . exception , null )
1048
+ t . equal ( vm . isUpdating , false )
1039
1049
} )
1040
1050
} )
You can’t perform that action at this time.
0 commit comments