refactor(alert): move logic to controller & add tests

 * Add missing tests that `close` button is actually visible
   Tests were passing even if link function was empty.