Added verification that optional parameters work

Added verification that optional parameters work for toHaveAttr() and toHaveProp().