@@ -12,7 +12,6 @@ export const Basic = () => {
1212 alt = "Image without ImageKit provider"
1313 height = { 300 }
1414 width = { 300 }
15- style = { { color : "red" } } // we add `color:red` styles in all Image because otherwise Next.js may add `color:transparent` styles to the image. This may causes flaky tests.
1615 />
1716
1817 < ImageKitProvider urlEndpoint = "https://ik.imagekit.io/demo/" >
@@ -21,27 +20,22 @@ export const Basic = () => {
2120 alt = "Image with ImageKit provider"
2221 height = { 300 }
2322 width = { 300 }
24- style = { { color : "red" } }
2523 />
2624
25+ { /* Width not number */ }
2726 < Image
2827 src = "/default-image.jpg"
29- alt = "With transformation"
30- transformation = { [ { height : 100 , width : 100 } ] }
31- height = { 300 }
32- width = { 300 }
33- style = { { color : "red" } }
28+ alt = "Image with width not number, should produce larger srcset"
29+ // @ts -ignore
30+ width = "300px"
3431 />
3532
36- { /* quality={50} */ }
3733 < Image
3834 src = "/default-image.jpg"
39- alt = "Image with quality"
40- quality = { 50 }
35+ alt = "With transformation"
4136 transformation = { [ { height : 100 , width : 100 } ] }
4237 height = { 300 }
4338 width = { 300 }
44- style = { { color : "red" } }
4539 />
4640
4741 < Image
@@ -53,7 +47,6 @@ export const Basic = () => {
5347 transformation = { [ { height : 100 , width : 100 } ] }
5448 height = { 300 }
5549 width = { 300 }
56- style = { { color : "red" } }
5750 />
5851
5952 { /* responsive images with sizes */ }
@@ -63,7 +56,15 @@ export const Basic = () => {
6356 sizes = "(max-width: 600px) 100vw, 50vw"
6457 height = { 300 }
6558 width = { 300 }
66- style = { { color : "red" } }
59+ />
60+
61+ { /* responsive images with sizes not having vw token */ }
62+ < Image
63+ src = "/default-image.jpg"
64+ alt = "Responsive image with sizes - should have very large srcset for all breakpoints"
65+ sizes = "300px"
66+ height = { 300 }
67+ width = { 300 }
6768 />
6869
6970 { /* urlEndpoint override */ }
@@ -74,7 +75,6 @@ export const Basic = () => {
7475 transformation = { [ { height : 100 , width : 100 } ] }
7576 height = { 300 }
7677 width = { 300 }
77- style = { { color : "red" } }
7878 />
7979
8080 { /* Pass className to the image tag as it is */ }
@@ -84,7 +84,6 @@ export const Basic = () => {
8484 className = "custom-class"
8585 height = { 300 }
8686 width = { 300 }
87- style = { { color : "red" } }
8887 />
8988
9089 { /* Lazy loading eager */ }
@@ -94,7 +93,6 @@ export const Basic = () => {
9493 loading = "eager"
9594 height = { 300 }
9695 width = { 300 }
97- style = { { color : "red" } }
9896 />
9997
10098 { /* Transformation position test */ }
@@ -104,7 +102,16 @@ export const Basic = () => {
104102 transformationPosition = "path"
105103 height = { 300 }
106104 width = { 300 }
107- style = { { color : "red" } }
105+ />
106+
107+ { /* Transformation position test with custom transformations */ }
108+ < Image
109+ src = "/default-image.jpg"
110+ alt = "Image with path transformation + custom transformations"
111+ transformationPosition = "path"
112+ transformation = { [ { height : 100 , width : 100 } ] }
113+ height = { 300 }
114+ width = { 300 }
108115 />
109116
110117 < Image
@@ -113,7 +120,6 @@ export const Basic = () => {
113120 transformationPosition = "path"
114121 height = { 300 }
115122 width = { 300 }
116- style = { { color : "red" } }
117123 />
118124
119125 { /* Responsive off */ }
@@ -125,8 +131,7 @@ export const Basic = () => {
125131 transformation = { [ {
126132 named : "restrict-unnamed" ,
127133 } ] }
128- style = { { color : "red" } }
129- responsive = { false }
134+ responsive = { true }
130135 sizes = "(max-width: 600px) 100vw, 50vw"
131136 />
132137
0 commit comments