jmpressjs / jmpress.js

A jQuery plugin to build a website on the infinite canvas
http://jmpressjs.github.com/jmpress.js
1.5k stars 237 forks source link

Fix non deterministic test #174

Open FagnerMartinsBrack opened 9 years ago

FagnerMartinsBrack commented 9 years ago

The test 13 fails in the screenshot at #169 in Chrome at windows because it is testing against the top level container of the plugin instead of the parent of the steps (which I suppose is the actual canvas the test refers to). The top level container always have a transition-duration property in firefox with the value of 0s, so this test always passes in Firefox and always fails in chrome (see below)

Chrome optimizes the "transition-duration" and puts the duration inside "webkit-transition" property in the "style" attribute, so testing against the style property doesn't actually works across all browsers.

To fix, test against the actual canvas element and instead of relying that the browser puts the transition-duration correctly inside the style attribute, test againt the actual css value (which tests for the property existence AND the correct value).

https://github.com/web-stories/jmpress.js/commit/5e8a1275c43cd73a2fe1fe4167195c092e71d4a3