Skip to content

Commit

Permalink
Add tests for multichar delimiters.
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeraj Baid committed May 13, 2015
1 parent ce1237f commit f367de3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions VENTokenFieldSampleTests/VENTokenFieldSampleTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ - (void)testBasicFlow

[tester enterTextIntoCurrentFirstResponder:@"Andy;"];
[tester waitForViewWithAccessibilityLabel:@"Andy,"];

[tester enterTextIntoCurrentFirstResponder:@"Sam--"];
[tester waitForViewWithAccessibilityLabel:@"Sam,"];

// Make sure everything else is still there.
[tester waitForViewWithAccessibilityLabel:@"Ayaka,"];
Expand All @@ -41,11 +44,12 @@ - (void)testBasicFlow
[tester waitForViewWithAccessibilityLabel:@"Octocat,"];
[tester waitForViewWithAccessibilityLabel:@"Steven,"];
[tester waitForViewWithAccessibilityLabel:@"Andy,"];
[tester waitForViewWithAccessibilityLabel:@"Sam,"];

// Delete
[tester enterTextIntoCurrentFirstResponder:@"\b"];
[tester enterTextIntoCurrentFirstResponder:@"\b"];
[tester waitForAbsenceOfViewWithAccessibilityLabel:@"Andy,"];
[tester waitForAbsenceOfViewWithAccessibilityLabel:@"Sam,"];

// Clear remaining names to reset state for next test
[tester tapViewWithAccessibilityLabel:@"To"];
Expand All @@ -59,6 +63,8 @@ - (void)testBasicFlow
[tester enterTextIntoCurrentFirstResponder:@"\b"];
[tester enterTextIntoCurrentFirstResponder:@"\b"];
[tester enterTextIntoCurrentFirstResponder:@"\b"];
[tester enterTextIntoCurrentFirstResponder:@"\b"];
[tester enterTextIntoCurrentFirstResponder:@"\b"];
}

- (void)testResignFirstResponder
Expand Down Expand Up @@ -100,13 +106,16 @@ - (void)testResignFirstResponderAndCollapse

[tester enterTextIntoCurrentFirstResponder:@"Andy;"];
[tester waitForViewWithAccessibilityLabel:@"Andy,"];

[tester enterTextIntoCurrentFirstResponder:@"Sam--"];
[tester waitForViewWithAccessibilityLabel:@"Sam,"];

[tester tapViewWithAccessibilityLabel:@"Resign First Responder"];
[tester waitForAbsenceOfSoftwareKeyboard];
[tester tapViewWithAccessibilityLabel:@"Collapse token field"];

// Confirm the collapse label
[tester waitForViewWithAccessibilityLabel:@"6 people"];
[tester waitForViewWithAccessibilityLabel:@"7 people"];

// Remove one name and check again
[tester tapScreenAtPoint:tokenField.center];
Expand All @@ -116,7 +125,7 @@ - (void)testResignFirstResponderAndCollapse
[tester tapViewWithAccessibilityLabel:@"Resign First Responder"];
[tester waitForAbsenceOfSoftwareKeyboard];
[tester tapViewWithAccessibilityLabel:@"Collapse token field"];
[tester waitForViewWithAccessibilityLabel:@"5 people"];
[tester waitForViewWithAccessibilityLabel:@"6 people"];
}

@end

0 comments on commit f367de3

Please sign in to comment.