function checkHasPopUp() {
  menuButton.enterDocument();
  assertFalse(
      'Menu button must have aria-haspopup attribute set to false',
      aria.getState(menuButton.getElement(), State.HASPOPUP));
  const menu = new Menu();
  menu.createDom();
  menuButton.setMenu(menu);
  assertTrue(
      'Menu button must have aria-haspopup attribute set to true',
      aria.getState(menuButton.getElement(), State.HASPOPUP));
  menuButton.setMenu(null);
  assertFalse(
      'Menu button must have aria-haspopup attribute set to false',
      aria.getState(menuButton.getElement(), State.HASPOPUP));
}
Check if the aria-haspopup property is set correctly.