All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m44s
registrationEntry accepts an https url, or http when the host is localhost, *.localhost, 127.0.0.1 or ::1. A test pins both sides, including a look-alike host. The two tests that pass config.json as a ClientConfig now cast it, so tsc is clean for them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
20 lines
752 B
TypeScript
20 lines
752 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { ClientConfig, clientDefaultServer } from './useClientConfig';
|
|
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', () => {
|
|
expect(clientDefaultServer(config as ClientConfig)).toBe('gamecult.org');
|
|
});
|
|
});
|