Skip to content

Commit 595f50d

Browse files
committed
break the tests
1 parent 16440ca commit 595f50d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/dynamics.coffee

+24
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,30 @@ describe 'dynamics.animate', ->
253253
done()
254254
, 150
255255

256+
257+
it 'animates the points of a svg path correctly', (done) ->
258+
el = document.createElement('path')
259+
260+
# On chrome 52 getComputedStyle give a "d" property for path
261+
# Mock window.getComputedStyle
262+
style = window.getComputedStyle(el, null)
263+
style.setProperty('d', 'path(10 20 30)')
264+
oldComputed = window.getComputedStyle
265+
window.getComputedStyle = (el, pseudoElt) -> style
266+
267+
dynamics.tests.isSVG = (el) -> true
268+
el.setAttribute("d", "M101.88,22 C101.88,18.25")
269+
dynamics.animate(el, {
270+
d: "M50,10 C88.11,20.45"
271+
}, {
272+
duration: 100
273+
})
274+
setTimeout ->
275+
expect(el.getAttribute("d")[0]).to.be.equal('M')
276+
window.getComputedStyle = oldComputed # remove mock to avoid conflict for the next test
277+
done()
278+
, 50
279+
256280
it 'animates properties of an object correctly', (done) ->
257281
assertTypes = (object) ->
258282
expect(typeof(object.number)).to.be.equal('number', 'object.number has the wrong type')

0 commit comments

Comments
 (0)