- describe('encodeHash', () => {
- it('should ignore path without hash', () => {
- // given
- const path = 'path/without/hash';
-
- // when
- const result = encodeHash(path);
-
- // then
- expect(result).toEqual(path);
- });
-
- it('should replace all hashes within the path', () => {
- // given
- const path = 'path/with/hash # and one more #';
- const expectedResult = 'path/with/hash %23 and one more %23';
-
- // when
- const result = encodeHash(path);
-
- // then
- expect(result).toEqual(expectedResult);
- });
- });
-