elm-css icon indicating copy to clipboard operation
elm-css copied to clipboard

Tests needed for Css.Transitions

Open rtfeldman opened this issue 8 years ago • 8 comments

#324 implemented CSS transitions. Great start!

However, we need lots of tests before these can be released with any confidence. 😄

Anyone interested in contributing some?

rtfeldman avatar Dec 17 '17 03:12 rtfeldman

Hi there! I would like to contribute here. Let me know how best to start on this?

tsawan avatar Jan 26 '18 10:01 tsawan

I've started going through transitions source and tests for other modules.

tsawan avatar Feb 06 '18 15:02 tsawan

Awesome, thanks @tsawan!

The module just had documentation merged in https://github.com/rtfeldman/elm-css/pull/382 in case those are helpful!

rtfeldman avatar Feb 07 '18 23:02 rtfeldman

@rtfeldman please have a look at this gist and let me know if I am on the right track. note that I had to change Transitions source to export Transition(..), Animatable(..), propToString, durationTransition.

https://gist.github.com/tsawan/059301b64d5220fdecc26cd35a822d66

tsawan avatar Feb 10 '18 18:02 tsawan

@rtfeldman I guess exposing durationTransition was a mistake since I should only be testing public API. Let me know if it's ok to export propToString and timingFunctionToString helper functions from the Transitions.elm so I can try to finish this off?

tsawan avatar Mar 03 '18 08:03 tsawan

@tsawan Thank you for this, and really sorry I took so long responding!

I would definitely not change the exposing of the module. What I'd do instead is to render a trivial stylesheet all the way to a String (e.g. "p { background-color: blue; }) and then test the compiled string.

Check out expectPropertyWorks in tests/Properties.elm - I'd start by copying that, and then modifying it for your purposes!

rtfeldman avatar Mar 16 '18 20:03 rtfeldman

@rtfeldman I am a bit stuck on tests for functions that take TimingFunction (e.g,. background3). Since Css.Transitions.TimingFunction is not exposed, I can't add type signatures.

tsawan avatar Mar 20 '18 15:03 tsawan

@rtfeldman PR submitted.

tsawan avatar Mar 30 '18 12:03 tsawan