This commit is contained in:
@@ -20,6 +20,7 @@ describe('application navigation', () => {
|
||||
['/configs/42', 'releases', '/configs'],
|
||||
['/leaderboard/players/42', 'players', '/leaderboard'],
|
||||
['/bank', 'players', '/bank'],
|
||||
['/afk', 'players', '/afk'],
|
||||
['/moderation', 'players', '/moderation'],
|
||||
['/settings/users', 'admin', '/settings/users'],
|
||||
['/server-keys', 'admin', '/server-keys']
|
||||
@@ -62,6 +63,14 @@ describe('application navigation', () => {
|
||||
expect(navigationLocation('/server-keys', 'super_viewer')?.item.shortcut).toBe('k');
|
||||
});
|
||||
|
||||
it('keeps AFK beside Bank for every signed-in role', () => {
|
||||
for (const role of ['viewer', 'super_viewer', 'operator', 'moderator', 'admin'] as const) {
|
||||
const items = visibleNavigation(role).find((group) => group.id === 'players')!.items;
|
||||
const bankIndex = items.findIndex((item) => item.href === '/bank');
|
||||
expect(items[bankIndex + 1]).toMatchObject({ label: 'AFK', href: '/afk' });
|
||||
}
|
||||
});
|
||||
|
||||
it('reserves private moderation navigation for moderators, administrators, and Super Viewers', () => {
|
||||
for (const role of ['admin', 'moderator', 'super_viewer'] as const)
|
||||
expect(navigationLocation('/moderation', role)?.group.id).toBe('players');
|
||||
|
||||
Reference in New Issue
Block a user