Skip to content

Commit 18af22e

Browse files
fix(post-icon): add package version in CDN fallback URL for v8 (#5090)
## πŸ“„ Description Updated the fallback CDN URL in the `post-icon` component for release/v8 branch. --- ## πŸ“ Checklist - βœ… My code follows the style guidelines of this project - πŸ› οΈ I have performed a self-review of my own code - πŸ“„ I have made corresponding changes to the documentation - ⚠️ My changes generate no new warnings or errors - πŸ§ͺ I have added tests that prove my fix is effective or that my feature works - βœ”οΈ New and existing unit tests pass locally with my changes --------- Co-authored-by: Oliver SchΓΌrch <[email protected]>
1 parent 2b26c40 commit 18af22e

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

β€Ž.changeset/strange-seas-drop.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@swisspost/design-system-components': patch
3+
---
4+
5+
Updated the fallback CDN URL in the `post-icon` component to include the current package version, ensuring icon requests match the used component version.
6+

β€Žpackages/components/cypress.config.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { defineConfig } = require('cypress');
2-
2+
const { version } = require('./package.json');
33
module.exports = defineConfig({
44
e2e: {
55
baseUrl: 'http://localhost:9001',
@@ -8,6 +8,9 @@ module.exports = defineConfig({
88
viewportWidth: 1024,
99
viewportHeight: 576,
1010
},
11+
env: {
12+
PACKAGE_VERSION: version,
13+
},
1114
includeShadowDom: true,
1215
retries: {
1316
runMode: 1,

β€Žpackages/components/cypress/e2e/icon.cy.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ describe('Icon', () => {
197197
cy.get('@inner').should(
198198
'have.css',
199199
'mask-image',
200-
'url("https://unpkg.com/@swisspost/design-system-icons/public/post-icons/1000.svg")',
201-
);
200+
`url("https://unpkg.com/@swisspost/design-system-icons@${Cypress.env('PACKAGE_VERSION')}/public/post-icons/1000.svg")`, );
202201
});
203202
});
204203

β€Žpackages/components/src/components/post-icon/post-icon.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type UrlDefinition = {
88
definesSlug: boolean;
99
};
1010

11-
const CDN_URL = 'https://unpkg.com/@swisspost/design-system-icons/public/post-icons';
11+
const CDN_URL = `https://unpkg.com/@swisspost/design-system-icons@${version}/public/post-icons`;
1212
const ANIMATION_NAMES = [
1313
'cylon',
1414
'cylon-vertical',

0 commit comments

Comments
Β (0)