mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 19:03:47 +00:00
25 lines
989 B
TypeScript
25 lines
989 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');
|
|
});
|
|
|
|
it('should handle ontime app links', () => {
|
|
const serverUrl = 'https://app.getontime.no/user-hash';
|
|
const baseUri = 'user-hash';
|
|
const destination = linkToOtherHost('app.getontime.no', 'path', serverUrl, baseUri);
|
|
expect(destination).toBe('https://app.getontime.no/user-hash/path');
|
|
});
|
|
});
|