fix: Make getParentContainer work with query parameters

This commit is contained in:
Joachim Van Herwegen
2024-04-18 11:18:03 +02:00
parent f73dfb31c0
commit 099897013c
2 changed files with 17 additions and 6 deletions

View File

@@ -19,7 +19,9 @@ describe('A BaseIdentifierStrategy', (): void => {
describe('getParentContainer', (): void => {
it('returns the parent identifier.', async(): Promise<void> => {
expect(strategy.getParentContainer({ path: 'http://example.com/foo/bar' })).toEqual({ path: 'http://example.com/foo/' });
expect(strategy.getParentContainer({ path: 'http://example.com/foo//' })).toEqual({ path: 'http://example.com/' });
expect(strategy.getParentContainer({ path: 'http://example.com/foo/bar/' })).toEqual({ path: 'http://example.com/foo/' });
expect(strategy.getParentContainer({ path: 'http://example.com/foo/bar?q=5' })).toEqual({ path: 'http://example.com/foo/' });
});
it('errors when attempting to get the parent of an unsupported identifier.', async(): Promise<void> => {