mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Replace getParentContainer util function with ContainerManager
This commit is contained in:
@@ -2,7 +2,6 @@ import {
|
||||
decodeUriPathComponents,
|
||||
encodeUriPathComponents,
|
||||
ensureTrailingSlash,
|
||||
getParentContainer,
|
||||
toCanonicalUriPath,
|
||||
} from '../../../src/util/PathUtil';
|
||||
|
||||
@@ -29,16 +28,4 @@ describe('PathUtil', (): void => {
|
||||
expect(encodeUriPathComponents('/a%20path&/name')).toEqual('/a%2520path%26/name');
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getParentContainer', (): void => {
|
||||
it('returns the parent URl for a single call.', async(): Promise<void> => {
|
||||
expect(getParentContainer({ path: 'http://test.com/foo/bar' })).toEqual({ path: 'http://test.com/foo/' });
|
||||
expect(getParentContainer({ path: 'http://test.com/foo/bar/' })).toEqual({ path: 'http://test.com/foo/' });
|
||||
});
|
||||
|
||||
it('errors when the root of an URl is reached that does not match the input root.', async(): Promise<void> => {
|
||||
expect((): any => getParentContainer({ path: 'http://test.com/' }))
|
||||
.toThrow('Resource http://test.com/ does not have a parent container');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user