add user pages tests and refactor flash in app layout