-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds type definitions, tests, and the necessary js-core RC to enable absolute URL support in vue-imgix. The srcsset generation tests need to be updated to properly mock the static methods. Co-authored-by: Sherwin Heydarbeygi <[email protected]>
- Loading branch information
Showing
9 changed files
with
140 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
<template> | ||
<div> | ||
<h2>2-step URL API Example</h2> | ||
<h2>Absolute URL Static API Example</h2> | ||
// partial URL gets domain from client | ||
<ix-img | ||
src="/examples/pione.jpg" | ||
width="100" | ||
data-testid="2-step-api" | ||
/> | ||
<ix-img | ||
src="https://assets.imgix.net/examples/pione.jpg" | ||
width="100" | ||
data-testid="2-step-api" | ||
data-testid="static-api-relative" | ||
/> | ||
// absolute URL domain does not get overridden | ||
<ix-img | ||
src="https://sdk-test.imgix.net/amsterdam.jpg" | ||
width="100" | ||
data-testid="2-step-api" | ||
data-testid="static-api-absolute" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: '2-step-api', | ||
name: 'static-api', | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
describe('Static API', () => { | ||
it('should render image with relative URL', () => { | ||
cy.visit('/'); | ||
cy.findByTestId('static-api-relative').should(($image) => { | ||
expect($image.attr('src')).to.match(/assets.imgix.net/); | ||
expect($image.attr('srcset')).to.match(/assets.imgix.net/); | ||
}); | ||
}) | ||
it('should render image with an absolute URL', () => { | ||
cy.visit('/'); | ||
cy.findByTestId('static-api-absolute').should(($image) => { | ||
expect($image.attr('src')).to.match(/https:\/\/sdk-test.imgix.net\/amsterdam.jpg/, | ||
); | ||
expect($image.attr('srcset')).to.match(/sdk-test.imgix.net\/amsterdam.jpg/); | ||
}); | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1435,13 +1435,14 @@ | |
dependencies: | ||
"@hapi/hoek" "^9.0.0" | ||
|
||
"@imgix/js-core@^3.1.3": | ||
version "3.1.3" | ||
resolved "https://registry.yarnpkg.com/@imgix/js-core/-/js-core-3.1.3.tgz#9c26366f84f59e6c238c41455f45aacdf04862b7" | ||
integrity sha512-7HUIFy4dq9wLSJURgPhglSni50rt3af4cAyBip14koR5oPIGgTGs0W41aQZc5gyCesh7jZaSjm4VxiwqS7gszw== | ||
"@imgix/js-core@^3.6.0-rc.1": | ||
version "3.6.0-rc.1" | ||
resolved "https://registry.yarnpkg.com/@imgix/js-core/-/js-core-3.6.0-rc.1.tgz#483b0aaf857186a4fba34b0bc7d995af5f871108" | ||
integrity sha512-k0kSoZiVjHKFxgz/IFvW6KUH/SE4CZfT6huFmT2hU9RhFmZczXfk0ND6PzrElvFzmchrPLsGdgS9NdjWxmgUlg== | ||
dependencies: | ||
js-base64 "~2.6.0" | ||
js-base64 "~3.7.0" | ||
md5 "^2.2.1" | ||
ufo "^0.7.10" | ||
|
||
"@intervolga/optimize-cssnano-plugin@^1.0.5": | ||
version "1.0.6" | ||
|
@@ -8567,10 +8568,10 @@ joi@^17.4.0: | |
"@sideway/formula" "^3.0.0" | ||
"@sideway/pinpoint" "^2.0.0" | ||
|
||
js-base64@~2.6.0: | ||
version "2.6.4" | ||
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.6.4.tgz#f4e686c5de1ea1f867dbcad3d46d969428df98c4" | ||
integrity sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ== | ||
js-base64@~3.7.0: | ||
version "3.7.2" | ||
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.2.tgz#816d11d81a8aff241603d19ce5761e13e41d7745" | ||
integrity sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ== | ||
|
||
js-beautify@^1.6.12: | ||
version "1.11.0" | ||
|
@@ -12898,6 +12899,11 @@ typescript@~4.1.5: | |
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.6.tgz#1becd85d77567c3c741172339e93ce2e69932138" | ||
integrity sha512-pxnwLxeb/Z5SP80JDRzVjh58KsM6jZHRAOtTpS7sXLS4ogXNKC9ANxHHZqLLeVHZN35jCtI4JdmLLbLiC1kBow== | ||
|
||
ufo@^0.7.10: | ||
version "0.7.11" | ||
resolved "https://registry.yarnpkg.com/ufo/-/ufo-0.7.11.tgz#17defad497981290383c5d26357773431fdbadcb" | ||
integrity sha512-IT3q0lPvtkqQ8toHQN/BkOi4VIqoqheqM1FnkNWT9y0G8B3xJhwnoKBu5OHx8zHDOvveQzfKuFowJ0VSARiIDg== | ||
|
||
[email protected]: | ||
version "3.4.10" | ||
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.10.tgz#9ad9563d8eb3acdfb8d38597d2af1d815f6a755f" | ||
|