import type { InteractionHandler, } from '../../../../../src/identity/interaction/InteractionHandler'; import type { InteractionRoute } from '../../../../../src/identity/interaction/routing/InteractionRoute'; import { RelativeInteractionRoute } from '../../../../../src/identity/interaction/routing/RelativeInteractionRoute'; describe('A RelativeInteractionRoute', (): void => { const relativePath = '/relative/'; let route: jest.Mocked; let source: jest.Mocked; let relativeRoute: RelativeInteractionRoute; beforeEach(async(): Promise => { route = { getPath: jest.fn().mockReturnValue('http://example.com/'), } as any; source = { canHandle: jest.fn(), } as any; }); it('returns the joined path.', async(): Promise => { relativeRoute = new RelativeInteractionRoute(route, relativePath, source); expect(relativeRoute.getPath()).toBe('http://example.com/relative/'); relativeRoute = new RelativeInteractionRoute('http://example.com/', relativePath, source); expect(relativeRoute.getPath()).toBe('http://example.com/relative/'); }); });