add alert handlling unit tests