update platform API to return alert view instance when showing
add unit tests to cover the alert JavaScript API