From a0aa681c1d75df603dd1d1a3211518fd40a2d986 Mon Sep 17 00:00:00 2001 From: gpcf Date: Sun, 28 Jul 2024 14:00:52 +0200 Subject: Add unit test for /force_afk --- spec/afk_spec.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'spec/afk_spec.lua') diff --git a/spec/afk_spec.lua b/spec/afk_spec.lua index fb63339..c8b0aaa 100644 --- a/spec/afk_spec.lua +++ b/spec/afk_spec.lua @@ -59,5 +59,11 @@ describe("Afk works", function() local newplayer2 = Player("newplayer4") mineunit:execute_on_joinplayer(admin) assert.is_false(newplayer2._online) - end) + end) + it("Can force moderators to be marked afk", function () + local moderator = Player("moderator", {kick = true, ban = true}) + assert.is_true(xban.present["admin"]) + moderator:send_chat_message('/force_afk admin') + assert.is_not_true(xban.present["admin"]) + end) end) -- cgit v1.2.3