Refactor contactsData into alerts and use mocks to test adding alerts.