@@ -119,8 +119,10 @@ test.describe('next/image is using Netlify Image CDN', () => {
119
119
120
120
expect ( nextImageResponse . status ( ) ) . toBe ( 200 )
121
121
// ensure next/image is using Image CDN
122
- // source image is jpg, but when requesting it through Image CDN avif will be returned
123
- expect ( await nextImageResponse . headerValue ( 'content-type' ) ) . toEqual ( 'image/avif' )
122
+ // source image is jpg, but when requesting it through Image CDN avif or webp will be returned
123
+ expect ( [ 'image/avif' , 'image/webp' ] ) . toContain (
124
+ await nextImageResponse . headerValue ( 'content-type' ) ,
125
+ )
124
126
125
127
await expectImageWasLoaded ( page . locator ( 'img' ) )
126
128
} )
@@ -142,7 +144,9 @@ test.describe('next/image is using Netlify Image CDN', () => {
142
144
)
143
145
144
146
expect ( nextImageResponse . status ( ) ) . toBe ( 200 )
145
- expect ( await nextImageResponse . headerValue ( 'content-type' ) ) . toEqual ( 'image/avif' )
147
+ expect ( [ 'image/avif' , 'image/webp' ] ) . toContain (
148
+ await nextImageResponse . headerValue ( 'content-type' ) ,
149
+ )
146
150
147
151
await expectImageWasLoaded ( page . locator ( 'img' ) )
148
152
} )
@@ -164,7 +168,9 @@ test.describe('next/image is using Netlify Image CDN', () => {
164
168
)
165
169
166
170
expect ( nextImageResponse . status ( ) ) . toBe ( 200 )
167
- expect ( await nextImageResponse . headerValue ( 'content-type' ) ) . toEqual ( 'image/avif' )
171
+ expect ( [ 'image/avif' , 'image/webp' ] ) . toContain (
172
+ await nextImageResponse . headerValue ( 'content-type' ) ,
173
+ )
168
174
169
175
await expectImageWasLoaded ( page . locator ( 'img' ) )
170
176
} )
@@ -183,7 +189,9 @@ test.describe('next/image is using Netlify Image CDN', () => {
183
189
)
184
190
185
191
expect ( nextImageResponse ?. status ( ) ) . toBe ( 200 )
186
- expect ( await nextImageResponse . headerValue ( 'content-type' ) ) . toEqual ( 'image/avif' )
192
+ expect ( [ 'image/avif' , 'image/webp' ] ) . toContain (
193
+ await nextImageResponse . headerValue ( 'content-type' ) ,
194
+ )
187
195
188
196
await expectImageWasLoaded ( page . locator ( 'img' ) )
189
197
} )
@@ -203,7 +211,9 @@ test.describe('next/image is using Netlify Image CDN', () => {
203
211
)
204
212
205
213
expect ( nextImageResponse . status ( ) ) . toEqual ( 200 )
206
- expect ( await nextImageResponse . headerValue ( 'content-type' ) ) . toEqual ( 'image/avif' )
214
+ expect ( [ 'image/avif' , 'image/webp' ] ) . toContain (
215
+ await nextImageResponse . headerValue ( 'content-type' ) ,
216
+ )
207
217
208
218
await expectImageWasLoaded ( page . locator ( 'img' ) )
209
219
} )
0 commit comments