@@ -132,5 +132,54 @@ describe('$sniffer', function() {
132
132
} ) ;
133
133
} ) ;
134
134
135
+ it ( 'should be false when there is no transition style' , function ( ) {
136
+ module ( function ( $provide ) {
137
+ var doc = {
138
+ body : {
139
+ style : { }
140
+ }
141
+ } ;
142
+ $provide . value ( '$document' , jqLite ( doc ) ) ;
143
+ } ) ;
144
+ inject ( function ( $sniffer ) {
145
+ expect ( $sniffer . supportsTransitions ) . toBe ( false ) ;
146
+ } ) ;
147
+ } ) ;
148
+
149
+ it ( 'should be true with vendor-specific transitions' , function ( ) {
150
+ module ( function ( $provide ) {
151
+ var transitionStyle = '1s linear all' ;
152
+ var doc = {
153
+ body : {
154
+ style : {
155
+ WebkitTransition : transitionStyle ,
156
+ MozTransition : transitionStyle ,
157
+ OTransition : transitionStyle
158
+ }
159
+ }
160
+ } ;
161
+ $provide . value ( '$document' , jqLite ( doc ) ) ;
162
+ } ) ;
163
+ inject ( function ( $sniffer ) {
164
+ expect ( $sniffer . supportsTransitions ) . toBe ( true ) ;
165
+ } ) ;
166
+ } ) ;
167
+
168
+ it ( 'should be true with w3c-style transitions' , function ( ) {
169
+ module ( function ( $provide ) {
170
+ var doc = {
171
+ body : {
172
+ style : {
173
+ transition : '1s linear all'
174
+ }
175
+ }
176
+ } ;
177
+ $provide . value ( '$document' , jqLite ( doc ) ) ;
178
+ } ) ;
179
+ inject ( function ( $sniffer ) {
180
+ expect ( $sniffer . supportsTransitions ) . toBe ( true ) ;
181
+ } ) ;
182
+ } ) ;
183
+
135
184
} ) ;
136
185
} ) ;
0 commit comments