Giter VIP home page Giter VIP logo

Comments (6)

ldhasson avatar ldhasson commented on August 30, 2024

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.

gtanner avatar gtanner commented on August 30, 2024

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.

ldhasson avatar ldhasson commented on August 30, 2024

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.

gtanner avatar gtanner commented on August 30, 2024

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.

gtanner avatar gtanner commented on August 30, 2024

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.

ldhasson avatar ldhasson commented on August 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.