Skip to content

Commit fef74f6

Browse files
committed
test: add test for uriparameter encoding
1 parent 018d10e commit fef74f6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/platform-sdk/test/request-utils.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,19 @@ describe('ApiRequestExecutor', () => {
6363
test('handle undefined variable map', async () => {
6464
expect(testQuery(undefined)).toEqual('')
6565
})
66+
67+
test('handle special characters in uri parameter', async () => {
68+
const request = {
69+
baseURL: 'http://base-url',
70+
method: 'GET' as const,
71+
uriTemplate: '/key={foo}/test/{bar}',
72+
pathVariables: {
73+
foo: 'foo[bar]',
74+
bar: 'bar',
75+
},
76+
}
77+
78+
expect(buildRelativeUri(request)).toEqual('/key=foo%5Bbar%5D/test/bar')
79+
})
6680
})
6781
})

0 commit comments

Comments
 (0)