Group server and host details into task sections
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { serverSection, serverSectionAnchor } from '../../src/lib/server-sections.js';
|
||||
|
||||
describe('server detail bookmarks', () => {
|
||||
it.each([
|
||||
['scoreboard', 'live', null], ['chat', 'live', 'chat'], ['matches', 'matches', null],
|
||||
['config', 'configuration', null], ['inventory', 'configuration', 'inventory'],
|
||||
['logs', 'diagnostics', 'logs'], ['diagnostics', 'diagnostics', null], ['history', 'history', null]
|
||||
])('preserves the destination of tab=%s', (tab, section, anchor) => {
|
||||
expect(serverSection(tab)).toBe(section);
|
||||
expect(serverSectionAnchor(tab)).toBe(anchor);
|
||||
});
|
||||
it('defaults unsupported tabs to Live and accepts the new sections', () => {
|
||||
expect(serverSection(null)).toBe('live');
|
||||
expect(serverSection('missing')).toBe('live');
|
||||
expect(serverSection('live')).toBe('live');
|
||||
expect(serverSection('configuration')).toBe('configuration');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user