function getExpectedBubblePositionWithGivenAlignment(alignRight = undefined) {
  const targetPosition = style.getFramedPageOffset(link, window);
  const targetWidth = link.offsetWidth;
  /** @suppress {visibility} suppression added to enable type checking */
  const bubbleSize = style.getSize(bubble.bubbleContainer_);
  const expectedBubbleX = alignRight ?
      targetPosition.x + targetWidth - bubbleSize.width :
      targetPosition.x;
  /** @suppress {visibility} suppression added to enable type checking */
  const expectedBubbleY =
      link.offsetHeight + targetPosition.y + Bubble.VERTICAL_CLEARANCE_;

  return {x: expectedBubbleX, y: expectedBubbleY};
}
This is a helper function for getting the expected position of the bubble.
(align to the right or the left of the target element).  Align left by
default and align right if alignRight is true. The expected Y is
unaffected by alignment.
@param {boolean=} alignRight Sets the expected alignment to be right.