2026-11-11 01:30:16 +00:00
|
|
|
import { describe, expect, it } from 'vitest';
|
2026-11-11 01:31:26 +00:00
|
|
|
import { ClientConfig, clientDefaultServer } from './useClientConfig';
|
2026-11-11 01:30:16 +00:00
|
|
|
import config from '../../../config.json';
|
|
|
|
|
|
|
|
|
|
describe('default homeserver', () => {
|
|
|
|
|
it('is gamecult.org when the config names none', () => {
|
|
|
|
|
expect(clientDefaultServer({})).toBe('gamecult.org');
|
|
|
|
|
expect(clientDefaultServer({ homeserverList: [] })).toBe('gamecult.org');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('is the listed server the config points at', () => {
|
|
|
|
|
expect(
|
|
|
|
|
clientDefaultServer({ homeserverList: ['chat.gamecult.org'], defaultHomeserver: 0 })
|
|
|
|
|
).toBe('chat.gamecult.org');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('is gamecult.org in the repo config.json too', () => {
|
2026-11-11 01:31:26 +00:00
|
|
|
expect(clientDefaultServer(config as ClientConfig)).toBe('gamecult.org');
|
2026-11-11 01:30:16 +00:00
|
|
|
});
|
|
|
|
|
});
|