GroupTestUtils
Helpers for injecting group membership onto a PlayerMock in tests.
GroupUtils answers rank and role from two engine calls -- GetRolesInGroupAsync
(primary) and GetGroupsAsync (fallback) -- and only those calls are intercepted for
mocks, so its parsing and fallback logic runs for real in tests. GroupTestUtils.assignGroupInfo
writes both injected results from one rank/role pair so the answer is coherent whichever
path production code takes.
Functions
assignGroupInfo
GroupTestUtils.assignGroupInfo() → ()Injects membership in a group for a mock at both engine calls GroupUtils reads, replacing any earlier assignment for the same group. Assign multiple groups by calling once per group.
GroupTestUtils.assignGroupInfo(playerMock, 372, { rank = 230, role = "Admin" })
-- GroupUtils.promiseRankInGroup(playerMock, 372) resolves 230,
-- promiseRoleInGroup(playerMock, 372) resolves "Admin"