Skip to content

Commit

Permalink
break the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Grafikart committed Aug 11, 2016
1 parent 16440ca commit 595f50d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/dynamics.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,30 @@ describe 'dynamics.animate', ->
done()
, 150


it 'animates the points of a svg path correctly', (done) ->
el = document.createElement('path')

# On chrome 52 getComputedStyle give a "d" property for path
# Mock window.getComputedStyle
style = window.getComputedStyle(el, null)
style.setProperty('d', 'path(10 20 30)')
oldComputed = window.getComputedStyle
window.getComputedStyle = (el, pseudoElt) -> style

dynamics.tests.isSVG = (el) -> true
el.setAttribute("d", "M101.88,22 C101.88,18.25")
dynamics.animate(el, {
d: "M50,10 C88.11,20.45"
}, {
duration: 100
})
setTimeout ->
expect(el.getAttribute("d")[0]).to.be.equal('M')
window.getComputedStyle = oldComputed # remove mock to avoid conflict for the next test
done()
, 50

it 'animates properties of an object correctly', (done) ->
assertTypes = (object) ->
expect(typeof(object.number)).to.be.equal('number', 'object.number has the wrong type')
Expand Down

0 comments on commit 595f50d

Please sign in to comment.