Use more conventioal way of checking for a function
update mocha
Display the target element if it's hidden initially

Fixing an issue when the target element is hidden when `display: none`
is set on it.

There are several cases available:

1. The target element is enclosed by a hidden parent.
  - We don't need to do anything.

2. The target element is hidden either by a css rule or a style
  attribute.
  - We capture the original display value and apply display: block to
    reveal the element inside of the dialog.
  - The original display value is reverted on destroy.

Exceptions:

1. We don't support visibility: hidden as it collides with the dialog
  wrapper element in the hidden state and doesn't have any benefits.

2. We don't support `display: none !important` on the target.
  - I don't want to add overrides with `important` flag to give the
    client some flexibility in styling.