aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/snifferSpec.js
diff options
context:
space:
mode:
authorMatias Niemelä2013-04-03 23:35:18 -0400
committerMisko Hevery2013-04-08 21:26:19 -0700
commitbe08c075bd71cd26086378768bd1d57f99ff213e (patch)
treeba4124e8b000d01931b8736e09cdbbf7a8a73129 /test/ng/snifferSpec.js
parentd90a79632d699efcb63484e20d2bf756ebe94688 (diff)
downloadangular.js-be08c075bd71cd26086378768bd1d57f99ff213e.tar.bz2
fix($sniffer): $sniffer to support non-vendor prefixes
Diffstat (limited to 'test/ng/snifferSpec.js')
-rw-r--r--test/ng/snifferSpec.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/ng/snifferSpec.js b/test/ng/snifferSpec.js
index d791c17b..3a450e24 100644
--- a/test/ng/snifferSpec.js
+++ b/test/ng/snifferSpec.js
@@ -132,5 +132,54 @@ describe('$sniffer', function() {
});
});
+ it('should be false when there is no transition style', function() {
+ module(function($provide) {
+ var doc = {
+ body : {
+ style : {}
+ }
+ };
+ $provide.value('$document', jqLite(doc));
+ });
+ inject(function($sniffer) {
+ expect($sniffer.supportsTransitions).toBe(false);
+ });
+ });
+
+ it('should be true with vendor-specific transitions', function() {
+ module(function($provide) {
+ var transitionStyle = '1s linear all';
+ var doc = {
+ body : {
+ style : {
+ WebkitTransition : transitionStyle,
+ MozTransition : transitionStyle,
+ OTransition : transitionStyle
+ }
+ }
+ };
+ $provide.value('$document', jqLite(doc));
+ });
+ inject(function($sniffer) {
+ expect($sniffer.supportsTransitions).toBe(true);
+ });
+ });
+
+ it('should be true with w3c-style transitions', function() {
+ module(function($provide) {
+ var doc = {
+ body : {
+ style : {
+ transition : '1s linear all'
+ }
+ }
+ };
+ $provide.value('$document', jqLite(doc));
+ });
+ inject(function($sniffer) {
+ expect($sniffer.supportsTransitions).toBe(true);
+ });
+ });
+
});
});