Skip to content

Commit 19041c2

Browse files
ANKUR DWIVEDIANKUR DWIVEDI
authored andcommitted
added test case and updated logic
1 parent b146d73 commit 19041c2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

tests/url-generation.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,28 @@ describe("URL generation", function () {
7575
expect(url).equal(`https://ik.imagekit.io/test_url_endpoint/aéb/test_é_path_alt.jpg?ik-s=fca91582138ac65694425d52f0710b7ae2c3d7cf`);
7676
});
7777

78-
it('Signed URL with é in filename, path and query', function () {
78+
it('Signed URL with é in filename, path and transformation as path', function () {
7979
const url = imagekit.url({
8080
path: "/aéb/test_é_path_alt.jpg",
8181
signed: true,
82-
transformation: [ { raw: "l-text,i-Imagekité,fs-50,l-end"}]
82+
transformation: [ { raw: "l-text,i-Imagekité,fs-50,l-end"}],
83+
transformationPosition: "path"
8384
});
8485
console.log({url})
8586
expect(url).equal(`https://ik.imagekit.io/test_url_endpoint/tr:l-text,i-Imagekité,fs-50,l-end/aéb/test_é_path_alt.jpg?ik-s=38539311889a0721b46ebe30b5f297773d01d960`);
8687
});
8788

89+
it('Signed URL with é in filename, path and transformation as query', function () {
90+
const url = imagekit.url({
91+
path: "/aéb/test_é_path_alt.jpg",
92+
signed: true,
93+
transformation: [ { raw: "l-text,i-Imagekité,fs-50,l-end"}],
94+
transformationPosition: "query"
95+
});
96+
console.log({url})
97+
expect(url).equal(`https://ik.imagekit.io/test_url_endpoint/aéb/test_é_path_alt.jpg?tr=l-text%2Ci-Imagekit%C3%A9%2Cfs-50%2Cl-end&ik-s=0b0107144b34e3b33264c0cec1d29ec98d46cbbb`);
98+
});
99+
88100

89101
it('should generate the correct url with path param', function () {
90102
const url = imagekit.url({

0 commit comments

Comments
 (0)