diff options
Diffstat (limited to 'packages/integrations/image/test/picture-ssr-dev.test.js')
-rw-r--r-- | packages/integrations/image/test/picture-ssr-dev.test.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/integrations/image/test/picture-ssr-dev.test.js b/packages/integrations/image/test/picture-ssr-dev.test.js index 325e0d08b..39a5431dc 100644 --- a/packages/integrations/image/test/picture-ssr-dev.test.js +++ b/packages/integrations/image/test/picture-ssr-dev.test.js @@ -127,6 +127,16 @@ describe('SSR pictures - dev', function () { const src = image.attr('src'); const [route, params] = src.split('?'); + for (const srcset of picture.children('source').map((_, source) => source.attribs['srcset'])) { + for (const pictureSrc of srcset.split(',')) { + const pictureParams = pictureSrc.split('?')[1]; + + const expected = new URLSearchParams(params).get('href'); + const actual = new URLSearchParams(pictureParams).get('href').replace(/\s+\d+w$/, ''); + expect(expected).to.equal(actual); + } + } + expect(route).to.equal(url); const searchParams = new URLSearchParams(params); |