Skip to content

Commit 983e2d6

Browse files
committed
Update tests
1 parent a887d3d commit 983e2d6

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

packages/gatsby-plugin-image/src/components/__tests__/gatsby-image.server.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,15 @@ describe(`GatsbyImage server`, () => {
186186
data-main-image=""
187187
decoding="async"
188188
loading="lazy"
189-
sizes="192x192"
190189
style="opacity: 0;"
191190
/>
192191
`)
193192
})
194193

195194
it(`has a valid src value when fallback is provided in images`, () => {
196-
const images = { fallback: { src: `some-src-fallback.jpg` } }
195+
const images = {
196+
fallback: { src: `some-src-fallback.jpg`, sizes: `192x192` },
197+
}
197198

198199
const image: IGatsbyImageData = {
199200
width: 100,
@@ -233,6 +234,7 @@ icon64px.png 64w,
233234
icon-retina.png 2x,
234235
icon-ultra.png 3x,
235236
icon.svg`,
237+
sizes: `192x192`,
236238
},
237239
}
238240

@@ -242,7 +244,6 @@ icon.svg`,
242244
layout: `constrained`,
243245
images,
244246
placeholder: { sources: [] },
245-
sizes: `192x192`,
246247
backgroundColor: `red`,
247248
}
248249

@@ -294,7 +295,6 @@ icon.svg`,
294295
data-main-image=""
295296
decoding="async"
296297
loading="lazy"
297-
sizes="192x192"
298298
style="opacity: 0;"
299299
/>
300300
`)
@@ -317,9 +317,11 @@ icon.svg`,
317317
width: 100,
318318
height: 100,
319319
layout: `constrained`,
320-
images: { sources },
320+
images: {
321+
sources,
322+
fallback: { src: `some-src-fallback.jpg`, sizes: `192x192` },
323+
},
321324
placeholder: { sources: [] },
322-
sizes: `192x192`,
323325
backgroundColor: `red`,
324326
}
325327

@@ -339,6 +341,7 @@ icon.svg`,
339341
alt="A fake image for testing purpose"
340342
data-gatsby-image-ssr=""
341343
data-main-image=""
344+
data-src="some-src-fallback.jpg"
342345
decoding="async"
343346
loading="lazy"
344347
sizes="192x192"

0 commit comments

Comments
 (0)