function assertRenderDirection(subMenu, left) {
  subMenu.getParent().setHighlighted(subMenu);
  subMenu.showSubMenu();
  const menuItemPosition = style.getPageOffset(subMenu.getElement());
  const menuPosition = style.getPageOffset(subMenu.getMenu().getElement());
  assert(Math.abs(menuItemPosition.y - menuPosition.y) < 5);
  assertEquals(
      'Menu at: ' + menuPosition.x + ', submenu item at: ' + menuItemPosition.x,
      left, menuPosition.x < menuItemPosition.x);
}
Asserts that this sub menu renders in the right direction relative to
the parent menu.
@param {SubMenu} subMenu The sub menu.
@param {boolean} left True for left-pointing, false for right-pointing.