Add tests for multiple player teleport

This commit is contained in:
Ben Woo 2025-01-10 20:21:19 +08:00
parent 199da71be0
commit 5f15cce3f3

View File

@ -22,6 +22,14 @@ class TeleportCommandTest : AbstractCommandTest() {
assertLocation(server.getWorld("otherworld")?.spawnLocation, server.getPlayer("Player1")?.location)
}
@Test
fun `Teleport multiple players to other world`() {
assertTrue(Bukkit.dispatchCommand(console, "mv tp Player1,Player2 otherworld --unsafe"))
Thread.sleep(100) // wait for the player to teleport asynchronously
assertLocation(server.getWorld("otherworld")?.spawnLocation, server.getPlayer("Player1")?.location)
assertLocation(server.getWorld("otherworld")?.spawnLocation, server.getPlayer("Player2")?.location)
}
@Test
fun `Player no permission to teleport`() {
player.performCommand("mv tp otherworld")