mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-24 19:55:17 +01:00
Fixed tests
Created two new tests: 1. A test that closing inventory does not happen unless it is a known panel. 2. A test that verifies known panels are closed.
This commit is contained in:
parent
918f6de782
commit
d744b58638
@ -120,7 +120,20 @@ public class PanelListenerManagerTest {
|
|||||||
* Test method for {@link world.bentobox.bentobox.listeners.PanelListenerManager#onInventoryClick(org.bukkit.event.inventory.InventoryClickEvent)}.
|
* Test method for {@link world.bentobox.bentobox.listeners.PanelListenerManager#onInventoryClick(org.bukkit.event.inventory.InventoryClickEvent)}.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testOnInventoryClickOutside() {
|
public void testOnInventoryClickOutsideUnknownPanel() {
|
||||||
|
SlotType type = SlotType.OUTSIDE;
|
||||||
|
InventoryClickEvent e = new InventoryClickEvent(view, type, 0, click, inv);
|
||||||
|
plm.onInventoryClick(e);
|
||||||
|
Mockito.verify(player, Mockito.never()).closeInventory();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test method for {@link world.bentobox.bentobox.listeners.PanelListenerManager#onInventoryClick(org.bukkit.event.inventory.InventoryClickEvent)}.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testOnInventoryClickOutsideKnownPanel() {
|
||||||
|
// Put a panel in the list
|
||||||
|
PanelListenerManager.getOpenPanels().put(uuid, panel);
|
||||||
SlotType type = SlotType.OUTSIDE;
|
SlotType type = SlotType.OUTSIDE;
|
||||||
InventoryClickEvent e = new InventoryClickEvent(view, type, 0, click, inv);
|
InventoryClickEvent e = new InventoryClickEvent(view, type, 0, click, inv);
|
||||||
plm.onInventoryClick(e);
|
plm.onInventoryClick(e);
|
||||||
|
Loading…
Reference in New Issue
Block a user