summaryrefslogtreecommitdiff
path: root/packages/integrations/image/test/image-ssg.test.js
diff options
context:
space:
mode:
authorGravatar Tony Sullivan <tony.f.sullivan@outlook.com> 2022-07-19 04:48:22 +0000
committerGravatar GitHub <noreply@github.com> 2022-07-18 21:48:22 -0700
commit299b4afcab090bbe014d4eaf2a5ea439e8436bcc (patch)
treeb9091512848a664f1f7862bc14f0dc99145981dd /packages/integrations/image/test/image-ssg.test.js
parent60e38f6eb4273e29995b3aa83a37ab2433b66418 (diff)
downloadastro-299b4afcab090bbe014d4eaf2a5ea439e8436bcc.tar.gz
astro-299b4afcab090bbe014d4eaf2a5ea439e8436bcc.tar.zst
astro-299b4afcab090bbe014d4eaf2a5ea439e8436bcc.zip
Feat/image url hash (#3965)
* Including a hash of the full remote URL when building for SSG * chore: add changeset
Diffstat (limited to 'packages/integrations/image/test/image-ssg.test.js')
-rw-r--r--packages/integrations/image/test/image-ssg.test.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/integrations/image/test/image-ssg.test.js b/packages/integrations/image/test/image-ssg.test.js
index b0d12908c..3c5d4802e 100644
--- a/packages/integrations/image/test/image-ssg.test.js
+++ b/packages/integrations/image/test/image-ssg.test.js
@@ -58,16 +58,20 @@ describe('SSG images', function () {
});
describe('Remote images', () => {
+ // Hard-coding in the test! This should never change since the hash is based
+ // on the static `src` string
+ const HASH = 'Z1iI4xW';
+
it('includes src, width, and height attributes', () => {
const image = $('#google');
- expect(image.attr('src')).to.equal('/_image/googlelogo_color_272x92dp_544x184.webp');
+ expect(image.attr('src')).to.equal(`/_image/googlelogo_color_272x92dp-${HASH}_544x184.webp`);
expect(image.attr('width')).to.equal('544');
expect(image.attr('height')).to.equal('184');
});
it('built the optimized image', () => {
- verifyImage('_image/googlelogo_color_272x92dp_544x184.webp', {
+ verifyImage(`_image/googlelogo_color_272x92dp-${HASH}_544x184.webp`, {
width: 544,
height: 184,
type: 'webp',