mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Make IDP routes independent of handlers
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import type { InteractionRoute } from '../../../../../src/identity/interaction/routing/InteractionRoute';
|
||||
import {
|
||||
RelativePathInteractionRoute,
|
||||
} from '../../../../../src/identity/interaction/routing/RelativePathInteractionRoute';
|
||||
|
||||
describe('A RelativePathInteractionRoute', (): void => {
|
||||
const relativePath = '/relative/';
|
||||
let route: jest.Mocked<InteractionRoute>;
|
||||
let relativeRoute: RelativePathInteractionRoute;
|
||||
|
||||
beforeEach(async(): Promise<void> => {
|
||||
route = {
|
||||
getPath: jest.fn().mockReturnValue('http://example.com/'),
|
||||
};
|
||||
});
|
||||
|
||||
it('returns the joined path.', async(): Promise<void> => {
|
||||
relativeRoute = new RelativePathInteractionRoute(route, relativePath);
|
||||
expect(relativeRoute.getPath()).toBe('http://example.com/relative/');
|
||||
|
||||
relativeRoute = new RelativePathInteractionRoute('http://example.com/test/', relativePath);
|
||||
expect(relativeRoute.getPath()).toBe('http://example.com/test/relative/');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user