Skip to content

esttorhe/ETTextField-TestHelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ETTextField-TestHelper

UITextField category with convenience methods for testing.


This category was primarily created due to FBSnapshotTestCase and ReactiveCocoa working together and "making some issues" or unexpected behaviors on the snapshots.

Due to the RACSignals (rac_textSignal) bindings to UIButton RACCommands responding to changes in UITextField my FBSnapshotTestCase were failing.

Even though we were "injecting" the correct data to the model the bindings were not firing the signal to enable the button.

In here you'll find an easy method that will set the text and will also fire the rac_textSignal.

This is done by setting the text with KVC and sending actions to the control:

[self setValue:@"<Passed Text>" forKeyPath:NSStringFromSelector(@selector(text))]; // Set the text like this to ensure that `KVO` will fire.
[self sendActionsForControlEvents:UIControlEventEditingChanged]; // This will fire the `rac_textSignal` and its effects.

##Contact Twitter: @esttorhe

About

UITextField category with convenience methods for testing.

Resources

License

Stars

Watchers

Forks

Packages

No packages published