Repository: flex-sdk
Updated Branches:
  refs/heads/develop 4f8074747 -> 1a15b4a51


FLEX-34885
Adding more checks to make sure that when generic PropertyChangeEvents are 
dispatched, the objects that dispatch them are not moved to another location in 
the ListCollectionView.


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/1a15b4a5
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/1a15b4a5
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/1a15b4a5

Branch: refs/heads/develop
Commit: 1a15b4a510926a91c11aacdc5c8e059189e4ec3b
Parents: 4f80747
Author: Mihai Chira <[email protected]>
Authored: Tue Feb 23 13:00:51 2016 +0100
Committer: Mihai Chira <[email protected]>
Committed: Tue Feb 23 13:00:51 2016 +0100

----------------------------------------------------------------------
 .../ListCollectionView_PropertyChangeEvent_Tests.as            | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/1a15b4a5/frameworks/projects/framework/tests/mx/collections/ListCollectionView_PropertyChangeEvent_Tests.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/framework/tests/mx/collections/ListCollectionView_PropertyChangeEvent_Tests.as
 
b/frameworks/projects/framework/tests/mx/collections/ListCollectionView_PropertyChangeEvent_Tests.as
index 7845080..b18c7de 100644
--- 
a/frameworks/projects/framework/tests/mx/collections/ListCollectionView_PropertyChangeEvent_Tests.as
+++ 
b/frameworks/projects/framework/tests/mx/collections/ListCollectionView_PropertyChangeEvent_Tests.as
@@ -101,6 +101,7 @@ package mx.collections {
             //given
             _sut.filterFunction = allowAll;
             _sut.refresh();
+            const positionOfFirstWorkout:int = 
_sut.getItemIndex(_firstWorkout);
 
             _noTimesFilterFunctionCalled = 0;
             _lastFilteredObject = null;
@@ -111,6 +112,7 @@ package mx.collections {
             //then - no fatal, and object has been filtered
             assertEquals(1, _noTimesFilterFunctionCalled);
             assertEquals(_firstWorkout, _lastFilteredObject);
+            assertEquals(positionOfFirstWorkout, 
_sut.getItemIndex(_firstWorkout));
         }
 
         [Test]
@@ -121,6 +123,7 @@ package mx.collections {
             _sut.filterFunction = allowAll;
             _sut.refresh();
             var positionOfNull:int = _sut.getItemIndex(null);
+            const positionOfFirstWorkout:int = 
_sut.getItemIndex(_firstWorkout);
 
             //when
             _firstWorkout.dispatchEvent(PROPERTY_CHANGE_EVENT);
@@ -128,6 +131,7 @@ package mx.collections {
             //then
             assertTrue(positionOfNull != -1);
             assertEquals(-1, _sut.getItemIndex(null));
+            assertEquals(positionOfFirstWorkout, 
_sut.getItemIndex(_firstWorkout));
         }
 
         [Test]
@@ -138,6 +142,7 @@ package mx.collections {
             _sut.filterFunction = allowAll;
             _sut.refresh();
             var positionOfNull:int = _sut.getItemIndex(null);
+            const positionOfFirstWorkout:int = 
_sut.getItemIndex(_firstWorkout);
 
             //when
             _firstWorkout.dispatchEvent(PROPERTY_CHANGE_EVENT_UPDATE);
@@ -145,6 +150,7 @@ package mx.collections {
             //then
             assertTrue(positionOfNull != -1);
             assertEquals(-1, _sut.getItemIndex(null));
+            assertEquals(positionOfFirstWorkout, 
_sut.getItemIndex(_firstWorkout));
         }
 
         [Test]

Reply via email to