@@ -896,18 +896,14 @@ if (!isIE9) {
896
896
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave v-leave-active' )
897
897
} ) . thenWaitFor ( nextFrame ) . then ( ( ) => {
898
898
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave-active v-leave-to' )
899
- } ) . thenWaitFor ( explicitDuration - buffer ) . then ( ( ) => {
900
- expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave-active v-leave-to' )
901
- } ) . thenWaitFor ( buffer * 2 ) . then ( ( ) => {
899
+ } ) . thenWaitFor ( explicitDuration + buffer ) . then ( ( ) => {
902
900
expect ( vm . $el . children . length ) . toBe ( 0 )
903
901
vm . ok = true
904
902
} ) . then ( ( ) => {
905
903
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter v-enter-active' )
906
904
} ) . thenWaitFor ( nextFrame ) . then ( ( ) => {
907
905
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter-active v-enter-to' )
908
- } ) . thenWaitFor ( explicitDuration - buffer ) . then ( ( ) => {
909
- expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter-active v-enter-to' )
910
- } ) . thenWaitFor ( buffer * 2 ) . then ( ( ) => {
906
+ } ) . thenWaitFor ( explicitDuration + buffer ) . then ( ( ) => {
911
907
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test' )
912
908
} ) . then ( done )
913
909
} )
@@ -930,18 +926,14 @@ if (!isIE9) {
930
926
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave v-leave-active' )
931
927
} ) . thenWaitFor ( nextFrame ) . then ( ( ) => {
932
928
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave-active v-leave-to' )
933
- } ) . thenWaitFor ( duration - buffer ) . then ( ( ) => {
934
- expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave-active v-leave-to' )
935
- } ) . thenWaitFor ( buffer * 2 ) . then ( ( ) => {
929
+ } ) . thenWaitFor ( duration + buffer ) . then ( ( ) => {
936
930
expect ( vm . $el . children . length ) . toBe ( 0 )
937
931
vm . ok = true
938
932
} ) . then ( ( ) => {
939
933
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter v-enter-active' )
940
934
} ) . thenWaitFor ( nextFrame ) . then ( ( ) => {
941
935
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter-active v-enter-to' )
942
- } ) . thenWaitFor ( explicitDuration - buffer ) . then ( ( ) => {
943
- expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter-active v-enter-to' )
944
- } ) . thenWaitFor ( buffer * 2 ) . then ( ( ) => {
936
+ } ) . thenWaitFor ( explicitDuration + buffer ) . then ( ( ) => {
945
937
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test' )
946
938
} ) . then ( done )
947
939
} )
@@ -964,18 +956,14 @@ if (!isIE9) {
964
956
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave v-leave-active' )
965
957
} ) . thenWaitFor ( nextFrame ) . then ( ( ) => {
966
958
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave-active v-leave-to' )
967
- } ) . thenWaitFor ( explicitDuration - buffer ) . then ( ( ) => {
968
- expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave-active v-leave-to' )
969
- } ) . thenWaitFor ( buffer * 2 ) . then ( ( ) => {
959
+ } ) . thenWaitFor ( explicitDuration + buffer ) . then ( ( ) => {
970
960
expect ( vm . $el . children . length ) . toBe ( 0 )
971
961
vm . ok = true
972
962
} ) . then ( ( ) => {
973
963
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter v-enter-active' )
974
964
} ) . thenWaitFor ( nextFrame ) . then ( ( ) => {
975
965
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter-active v-enter-to' )
976
- } ) . thenWaitFor ( duration - buffer ) . then ( ( ) => {
977
- expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter-active v-enter-to' )
978
- } ) . thenWaitFor ( buffer * 2 ) . then ( ( ) => {
966
+ } ) . thenWaitFor ( duration + buffer ) . then ( ( ) => {
979
967
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test' )
980
968
} ) . then ( done )
981
969
} )
@@ -1001,18 +989,14 @@ if (!isIE9) {
1001
989
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave v-leave-active' )
1002
990
} ) . thenWaitFor ( nextFrame ) . then ( ( ) => {
1003
991
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave-active v-leave-to' )
1004
- } ) . thenWaitFor ( leave - buffer ) . then ( ( ) => {
1005
- expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave-active v-leave-to' )
1006
- } ) . thenWaitFor ( buffer * 2 ) . then ( ( ) => {
992
+ } ) . thenWaitFor ( leave + buffer ) . then ( ( ) => {
1007
993
expect ( vm . $el . children . length ) . toBe ( 0 )
1008
994
vm . ok = true
1009
995
} ) . then ( ( ) => {
1010
996
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter v-enter-active' )
1011
997
} ) . thenWaitFor ( nextFrame ) . then ( ( ) => {
1012
998
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter-active v-enter-to' )
1013
- } ) . thenWaitFor ( enter - buffer ) . then ( ( ) => {
1014
- expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter-active v-enter-to' )
1015
- } ) . thenWaitFor ( buffer * 2 ) . then ( ( ) => {
999
+ } ) . thenWaitFor ( enter + buffer ) . then ( ( ) => {
1016
1000
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test' )
1017
1001
} ) . then ( done )
1018
1002
} )
@@ -1044,18 +1028,14 @@ if (!isIE9) {
1044
1028
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave v-leave-active' )
1045
1029
} ) . thenWaitFor ( nextFrame ) . then ( ( ) => {
1046
1030
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave-active v-leave-to' )
1047
- } ) . thenWaitFor ( leave1 - buffer ) . then ( ( ) => {
1048
- expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave-active v-leave-to' )
1049
- } ) . thenWaitFor ( buffer * 2 ) . then ( ( ) => {
1031
+ } ) . thenWaitFor ( leave1 + buffer ) . then ( ( ) => {
1050
1032
expect ( vm . $el . children . length ) . toBe ( 0 )
1051
1033
vm . ok = true
1052
1034
} ) . then ( ( ) => {
1053
1035
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter v-enter-active' )
1054
1036
} ) . thenWaitFor ( nextFrame ) . then ( ( ) => {
1055
1037
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter-active v-enter-to' )
1056
- } ) . thenWaitFor ( enter1 - buffer ) . then ( ( ) => {
1057
- expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter-active v-enter-to' )
1058
- } ) . thenWaitFor ( buffer * 2 ) . then ( ( ) => {
1038
+ } ) . thenWaitFor ( enter1 + buffer ) . then ( ( ) => {
1059
1039
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test' )
1060
1040
vm . enter = enter2
1061
1041
vm . leave = leave2
@@ -1065,18 +1045,14 @@ if (!isIE9) {
1065
1045
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave v-leave-active' )
1066
1046
} ) . thenWaitFor ( nextFrame ) . then ( ( ) => {
1067
1047
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave-active v-leave-to' )
1068
- } ) . thenWaitFor ( leave2 - buffer ) . then ( ( ) => {
1069
- expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-leave-active v-leave-to' )
1070
- } ) . thenWaitFor ( buffer * 2 ) . then ( ( ) => {
1048
+ } ) . thenWaitFor ( leave2 + buffer ) . then ( ( ) => {
1071
1049
expect ( vm . $el . children . length ) . toBe ( 0 )
1072
1050
vm . ok = true
1073
1051
} ) . then ( ( ) => {
1074
1052
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter v-enter-active' )
1075
1053
} ) . thenWaitFor ( nextFrame ) . then ( ( ) => {
1076
1054
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter-active v-enter-to' )
1077
- } ) . thenWaitFor ( enter2 - buffer ) . then ( ( ) => {
1078
- expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test v-enter-active v-enter-to' )
1079
- } ) . thenWaitFor ( buffer * 2 ) . then ( ( ) => {
1055
+ } ) . thenWaitFor ( enter2 + buffer ) . then ( ( ) => {
1080
1056
expect ( vm . $el . children [ 0 ] . className ) . toBe ( 'test' )
1081
1057
} ) . then ( done )
1082
1058
} )
0 commit comments