Repository: flex-sdk
Updated Branches:
  refs/heads/develop fd7de9f72 -> 3a71cc8ee


FLEX-34885
Added a unit test to make sure that object is re-run through the collection 
filter when any of its properties changes.


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

Branch: refs/heads/develop
Commit: 4b4cc0bb7b22aeda0a7d9001b25535c412be48e0
Parents: fd7de9f
Author: Mihai Chira <[email protected]>
Authored: Tue Mar 1 12:48:13 2016 +0100
Committer: Mihai Chira <[email protected]>
Committed: Tue Mar 1 12:48:13 2016 +0100

----------------------------------------------------------------------
 ...tCollectionView_PropertyChangeEvent_Tests.as | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/4b4cc0bb/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 b18c7de..c7d684b 100644
--- 
a/frameworks/projects/framework/tests/mx/collections/ListCollectionView_PropertyChangeEvent_Tests.as
+++ 
b/frameworks/projects/framework/tests/mx/collections/ListCollectionView_PropertyChangeEvent_Tests.as
@@ -116,6 +116,26 @@ package mx.collections {
         }
 
         [Test]
+        public function 
test_when_collection_item_changes_item_is_run_through_filter_and_there_is_no_fatal():void
+        {
+            //given
+            _sut.filterFunction = allowAll;
+            _sut.refresh();
+            const positionOfFirstWorkout:int = 
_sut.getItemIndex(_firstWorkout);
+
+            _noTimesFilterFunctionCalled = 0;
+            _lastFilteredObject = null;
+
+            //when
+            _firstWorkout.duration += 10;
+
+            //then - no fatal, and object has been filtered
+            assertEquals(1, _noTimesFilterFunctionCalled);
+            assertEquals(_firstWorkout, _lastFilteredObject);
+            assertEquals(positionOfFirstWorkout, 
_sut.getItemIndex(_firstWorkout));
+        }
+
+        [Test]
         public function 
test_when_collection_item_dispatches_PropertyChangeEvent_null_is_removed_from_list():void
         {
             //given

Reply via email to