[ASCellNode] Final revisions to behavior of setSelected: & setHighlighted:

This commit is contained in:
Hannah Trosi
2016-07-05 17:47:00 -07:00
parent 61d7c093a1
commit 3994f2089c
5 changed files with 43 additions and 34 deletions

View File

@@ -179,9 +179,8 @@
[testController.collectionView deselectItemAtIndexPath:indexPath animated:NO];
XCTAssertTrue(node.isSelected == NO, @"Deselecting cell should update node selection.");
// selecting cell should select node
UICollectionViewCell *cell = [testController.collectionView cellForItemAtIndexPath:indexPath];
cell.selected = YES;
// select the cell again, scroll down and back up, and check that the state persisted
[testController.collectionView selectItemAtIndexPath:indexPath animated:NO scrollPosition:UICollectionViewScrollPositionNone];
XCTAssertTrue(node.isSelected == YES, @"Selecting cell should update node selection.");
// reload cell (-prepareForReuse is called) & check that selected state is preserved
@@ -192,7 +191,7 @@
XCTAssertTrue(node.isSelected == YES, @"Reloaded cell should preserve state.");
// deselecting cell should deselect node
cell = [testController.collectionView cellForItemAtIndexPath:indexPath];
UICollectionViewCell *cell = [testController.collectionView cellForItemAtIndexPath:indexPath];
cell.selected = NO;
XCTAssertTrue(node.isSelected == NO, @"Deselecting cell should update node selection.");