mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 19:03:47 +00:00
0f57689750
* refactor: extract info component * feat: generate authenticated url * refactor: add companion select * refactor: ensure behaviour across environments
18 lines
680 B
TypeScript
18 lines
680 B
TypeScript
import { linkToOtherHost } from '../linkUtils';
|
|
|
|
describe('linkToOTherHost', () => {
|
|
it('should handle electron links', () => {
|
|
const serverUrl = 'http://localhost:4001';
|
|
const baseUri = '';
|
|
const destination = linkToOtherHost('192.168.10.166', 'path', serverUrl, baseUri);
|
|
expect(destination).toBe('http://192.168.10.166:4001/path');
|
|
});
|
|
|
|
it('should handle ontime cloud links', () => {
|
|
const serverUrl = 'https://cloud.getontime.no/user-hash';
|
|
const baseUri = 'user-hash';
|
|
const destination = linkToOtherHost('cloud.getontime.no', 'path', serverUrl, baseUri);
|
|
expect(destination).toBe('https://cloud.getontime.no/user-hash/path');
|
|
});
|
|
});
|