Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 5081982

Browse files
committed
test($animateCss): ensure that transitionStyle by itself doesn't trigger anything
Using `transitionStyle` without any other properties does not trigger an animation so we could have a test to assert that it doesn't do that.
1 parent 97d79ee commit 5081982

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

test/ngAnimate/animateCssSpec.js

+24-1
Original file line numberDiff line numberDiff line change
@@ -2054,7 +2054,7 @@ describe("ngAnimate $animateCss", function() {
20542054
});
20552055
});
20562056

2057-
describe("[transtionStyle]", function() {
2057+
describe("[transitionStyle]", function() {
20582058
it("should apply the transition directly onto the element and animate accordingly",
20592059
inject(function($animateCss, $rootElement) {
20602060

@@ -2129,6 +2129,29 @@ describe("ngAnimate $animateCss", function() {
21292129
expect(element.css('transition-property')).toMatch('color');
21302130
expect(style).toContain('ease-in');
21312131
}));
2132+
2133+
it("should only execute the animation if any CSS to styles are mixed into together",
2134+
inject(function($animateCss, $rootElement) {
2135+
2136+
var options = {
2137+
transitionStyle: '6s 4s ease-out all'
2138+
};
2139+
2140+
$animateCss(element, options).start();
2141+
triggerAnimationStartFrame();
2142+
2143+
expect(element.css(prefix + 'transition-delay')).not.toEqual('4s');
2144+
expect(element.css(prefix + 'transition-duration')).not.toEqual('6s');
2145+
expect(element.css(prefix + 'transition-timing-function')).not.toEqual('ease-out');
2146+
2147+
options.to = { color: 'brown' };
2148+
$animateCss(element, options).start();
2149+
triggerAnimationStartFrame();
2150+
2151+
expect(element.css(prefix + 'transition-delay')).toEqual('4s');
2152+
expect(element.css(prefix + 'transition-duration')).toEqual('6s');
2153+
expect(element.css(prefix + 'transition-timing-function')).toEqual('ease-out');
2154+
}));
21322155
});
21332156

21342157
describe("[keyframeStyle]", function() {

0 commit comments

Comments
 (0)