-
Notifications
You must be signed in to change notification settings - Fork 14
Support css transitions options in app projector #69
Conversation
@@ -45,6 +45,7 @@ | |||
"grunt-tslint": "^3.1.0", | |||
"grunt-typings": ">=0.1.5", | |||
"intern": "^3.2.3", | |||
"sinon": "1.14.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why pin to such an old version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah that is because I took it from core
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
word of caution, be careful, there be beasts in them sinon versions... if you find something that works, pin it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😈
@@ -234,6 +234,10 @@ function resolveOptions(registry: ReadOnlyRegistry, registryProvider: RegistryPr | |||
return options; | |||
} | |||
|
|||
function getTransitionOptionFromProjector(element: Element): boolean { | |||
return element.getAttribute('data-css-transitions') === 'true'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be cool if this worked with just <app-projector data-css-transitions>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure I'll add support for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like element.hasAttribute('data-css-transitions')
and ignoring the value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should support, <app-projector data-css-transitions>
, <app-projector data-css-transitions="true">
and <app-projector data-css-transitions="false">
now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any truthy value that is not ===
'true'
will be treated as false
.
'<app-projector data-css-transition> attribute': { | ||
'is false if empty'() { | ||
return app.realize(root).then(() => { | ||
assert.isTrue(projectorSpy.calledWith( match({ cssTransitions: false }))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other projects I've stopped using Sinon's assertions. This should also work:
const { args: [ { cssTransitions } ] } = projectorSpy.firstCall;
assert.isTrue(cssTransitions);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any particular reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any particular reason?
Wait you can't read my mind? 😞
It's partly because I find it too hard to memorize Sinon's assertion APIs. But also because AVA uses power-assert
and I tend to write boolean expressions as my test assertions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not overly fussed, I'll update if there is overwhelming support to do so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah it's fine as is 😄
plus I need to add sinon to the loader maps |
Requires a release of widgets |
88acb5d
to
37de3c8
Compare
No description provided.