Comments (6)
I have struggled with that. We definitely have methods in Core which are very amenable to better testing for sure, but how do you test that an animation is properly setup? I guess we can read back the CSS properties afterwards, but it's very minimal imho. I don't see clear benefits in testing that properties X, Y and Z have been properly altered.
from alice.
The key is testing what alice does, which is configure the css3 transitions on your elements. Alice doesn't do the animations, the browser does.
We don't need to test that a given css animation is rendered correctly in the browser, we need to test that when I run X on alice it generates what we would need to get the browser to render the expected animation.
from alice.
So how do you do that? You expect the "Wobble" animation to set the properties x, y, and z, and so after you call it, you test that? It seems to be a "literal" test on the actual method implementation and represents no guarantee that setting x, y and z even makes sense. That's the difficulty with testing animations imho. You may want a general test on Cheshire itself and test for all the properties modified, but individual sub-effects, i am not seeing what you'd actually test at all. It's like testing a setter method that it does set the value of X to the value put in. Seems to have little value to me.
from alice.
A lot of stuff happens in alice that is above and beyond just setting properties x, y and z that should be under test.
- default values for arguments
- correct conversions for values like scale from and to
- warning if no elements
- adding event listeners for animationend if on Mozilla
Plugin tests can be as simple as testing that it creates the expected opts object to pass to cheshire.
The tests will be valid and shouldn't be that much of a problem. The key is we want to have coverage for everything alice does for third party contributors to have a good basis that what they are changing isn't effecting the specifications or behaviour.
I can help @mlantz write a couple of these and make the judgement call on value once we iron one or two out.
from alice.
Also if we want to start changing and refactoring the code it would help to have a base of tests there to make sure we don't change any behaviours.
from alice.
OK, that makes sense... One thing we need to do is refactor the Core. There are key features that are being done there ,and they need to remain public for people to create additional master effects (i'll comment on the other issue). Let's make sure that those features are well defined and independent, and then composed by master effects.
from alice.
Related Issues (20)
- Parameter list should be more flexible with defining elements
- Default easing should be ease-in-out
- parseFloat() does not have a second parameter
- randomness property ignored for slide() HOT 1
- improve documentation to explain parameter values/defaults HOT 2
- running two animations at once confuses the times HOT 1
- Reorganize directory structure. HOT 1
- Modularize the code in the src folder HOT 3
- Remake the demo page with a responsive design HOT 1
- Embed jWorkflow into Alice.js by default
- Add an "onEnd" handler for animations
- audit plugin API surface and close around what shouldn't be public HOT 1
- To implement AliceJS my image disappears HOT 7
- IE 10 support HOT 2
- Keyframe rules are not deleted
- StyleSheets with Import Issue
- Support multiple axis animations
- Cannot chain cheshire rotate events HOT 7
- Tests' failing on IE 6, 7 and 8 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alice.