[BUGFIX] Fix bug in Popover.setOptions and add JSUnit tests