This commit is contained in:
@@ -20,6 +20,7 @@ describe('application navigation', () => {
|
||||
['/configs/42', 'releases', '/configs'],
|
||||
['/leaderboard/players/42', 'players', '/leaderboard'],
|
||||
['/bank', 'players', '/bank'],
|
||||
['/moderation', 'players', '/moderation'],
|
||||
['/settings/users', 'admin', '/settings/users'],
|
||||
['/server-keys', 'admin', '/server-keys']
|
||||
])('gives %s exactly one canonical home', (path, group, href) => {
|
||||
@@ -61,6 +62,13 @@ describe('application navigation', () => {
|
||||
expect(navigationLocation('/server-keys', 'super_viewer')?.item.shortcut).toBe('k');
|
||||
});
|
||||
|
||||
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');
|
||||
for (const role of ['operator', 'viewer'] as const)
|
||||
expect(navigationLocation('/moderation', role)).toBeNull();
|
||||
});
|
||||
|
||||
it('groups file releases together and retains Campaigns as its own destination', () => {
|
||||
expect(navigationGroups.map((group) => group.label)).toEqual([
|
||||
'Fleet',
|
||||
|
||||
Reference in New Issue
Block a user