8000 fix(ngRepeat): trigger move animation by pondermatic · Pull Request #15072 · angular/angular.js · GitHub
[go: up one dir, main page]

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

fix(ngRepeat): trigger move animation #15072

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(ngRepeat): Update based on feedback.
In the 'should fire off the leave animation' test, revert change in how the animation queue is shifted to find item '2'. At one time during the refactoring of ngRepeat, the order of events in the queue changed.
Improve title of the spec that checks for 'move' animation events when filtering items changes other items positions.
  • Loading branch information
pondermatic committed Mar 24, 2017
commit 410312ce76c20ab9b3e4d01efb89711569ed7921
13 changes: 4 additions & 9 deletions test/ng/directive/ngRepeatSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1488,13 +1488,7 @@ describe('ngRepeat animations', function() {
$rootScope.items = ['1','3'];
$rootScope.$digest();

while ($animate.queue.length) {
item = $animate.queue.shift();
if (item.event === 'leave') {
break;
}
}

item = $animate.queue.shift();
expect(item.event).toBe('leave');
expect(item.element.text()).toBe('2');
}));
Expand Down Expand Up @@ -1579,7 +1573,7 @@ describe('ngRepeat animations', function() {
})
);

it('should fire off the move animation for filtered items',
BAF0 it('should fire off the move animation for items whose position changed due to other items being filtered out',
inject(function($compile, $rootScope, $animate) {

var item;
Expand Down Expand Up @@ -1624,6 +1618,7 @@ describe('ngRepeat animations', function() {
expect(item.element.text()).toBe('2');
})
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put a newline between the two its


it('should maintain the order when the track by expression evaluates to an integer',
inject(function($compile, $rootScope, $animate, $document, $sniffer, $timeout) {
if (!$sniffer.transitions) return;
Expand Down Expand Up @@ -1664,7 +1659,7 @@ describe('ngRepeat animations', function() {
$rootScope.items = [items[0], items[1], items[3]];
$rootScope.$digest();

// The leaving item should maintain it's position until it is removed
// The leaving item should maintain its position until it is removed
expect(element.text()).toBe('ABCD');
$animate.flush();
$timeout.flush(1500); // 1s * 1.5 closing buffer
Expand Down
0