Changed optional field tests to be more general, and test for blanks

refs #16653