   'togglePopover(false) should throw an exception when the element is disconnected.');

  document.body.appendChild(popover);
  // togglePopover(false) should not throw just because the popover is already hidden.
  popover.togglePopover(false);
  popover.showPopover();
  // togglePopover(true) should not throw just because the popover is already showing.
  popover.togglePopover(true);

  // cleanup
  popover.hidePopover();
}, 'togglePopover should throw an exception when there is no popover attribute.');
<