Browse Source

make transition tests pass

Evan You 11 years ago
parent
commit
b3d1c7ed7a
1 changed files with 10 additions and 0 deletions
  1. 10 0
      test/unit/specs/transition_spec.js

+ 10 - 0
test/unit/specs/transition_spec.js

@@ -142,6 +142,7 @@ if (_.inBrowser && !_.isIE9) {
         // !IMPORTANT!
         // this ensures we force a layout for every test.
         _.nextTick(done)
+        spyOn(window, 'getComputedStyle').and.callThrough()
       })
 
       afterEach(function () {
@@ -265,6 +266,15 @@ if (_.inBrowser && !_.isIE9) {
         })
       })
 
+      it('cache transition sniff results', function () {
+        el.__v_trans.id = 'test'
+        el.classList.add('test')
+        transition.apply(el, 1, op, vm)
+        expect(window.getComputedStyle.calls.count()).toBe(1)
+        transition.apply(el, 1, op, vm)
+        expect(window.getComputedStyle.calls.count()).toBe(1)
+      })
+
     })
 
     describe('JavaScript transitions', function () {