Testing for error messages and flash message