From f367de388897ab254fd920a0c3bf4e0f14eb6043 Mon Sep 17 00:00:00 2001 From: Neeraj Baid Date: Wed, 13 May 2015 13:07:13 -0700 Subject: [PATCH] Add tests for multichar delimiters. --- .../VENTokenFieldSampleTests.m | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/VENTokenFieldSampleTests/VENTokenFieldSampleTests.m b/VENTokenFieldSampleTests/VENTokenFieldSampleTests.m index 7061db3..077040e 100644 --- a/VENTokenFieldSampleTests/VENTokenFieldSampleTests.m +++ b/VENTokenFieldSampleTests/VENTokenFieldSampleTests.m @@ -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,"]; @@ -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"]; @@ -59,6 +63,8 @@ - (void)testBasicFlow [tester enterTextIntoCurrentFirstResponder:@"\b"]; [tester enterTextIntoCurrentFirstResponder:@"\b"]; [tester enterTextIntoCurrentFirstResponder:@"\b"]; + [tester enterTextIntoCurrentFirstResponder:@"\b"]; + [tester enterTextIntoCurrentFirstResponder:@"\b"]; } - (void)testResignFirstResponder @@ -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]; @@ -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