mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Test requestService.uriEncodeBody
This commit is contained in:
@@ -579,4 +579,19 @@ describe('RequestService', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('uriEncodeBody', () => {
|
||||||
|
it('should properly encode the body', () => {
|
||||||
|
const body = {
|
||||||
|
'property1': 'multiple\nlines\nto\nsend',
|
||||||
|
'property2': 'sp&ci@l characters',
|
||||||
|
'sp&ci@l-chars in prop': 'test123',
|
||||||
|
};
|
||||||
|
const queryParams = service.uriEncodeBody(body);
|
||||||
|
expect(queryParams).toEqual(
|
||||||
|
'property1=multiple%0Alines%0Ato%0Asend&property2=sp%26ci%40l%20characters&sp%26ci%40l-chars%20in%20prop=test123'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user