Skip to content

Commit 2f37641

Browse files
committed
feat(tests): add test for transformationPosition as path in signed URL generation
1 parent 188eeee commit 2f37641

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/url-generation/signing.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,21 @@ describe('URL Signing', function () {
132132
expect(url).not.toContain('ik-s=');
133133
expect(url).not.toContain('ik-t=');
134134
});
135+
136+
it('transformationPosition as path', function () {
137+
const url = client.helper.buildSrc({
138+
urlEndpoint: 'https://ik.imagekit.io/demo/',
139+
src: 'sdk-testing-files/future-search.png',
140+
transformation: [{ width: 300, height: 200 }],
141+
transformationPosition: 'path',
142+
queryParameters: {
143+
version: '2.0',
144+
},
145+
signed: true,
146+
});
147+
148+
expect(url).toBe(
149+
'https://ik.imagekit.io/demo/tr:w-300,h-200/sdk-testing-files/future-search.png?version=2.0&ik-s=dd1ee8f83d019bc59fd57a5fc4674a11eb8a3496',
150+
);
151+
});
135152
});

0 commit comments

Comments
 (0)