Skip to content

Commit

Permalink
test: preload all icons for chromatic screenshot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfranco committed Jan 11, 2025
1 parent f842439 commit 24a1e99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/calcite-components/src/components/icon/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class Icon extends LitElement {
// #region Lifecycle

override connectedCallback(): void {
if (this.preload) {
if (this.preload || (import.meta.env.DEV && __STORYBOOK_SCREENSHOT_TEST_BUILD__)) {
this.visible = true;
this.loadIconPathData();
return;
Expand Down
1 change: 1 addition & 0 deletions packages/calcite-components/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export default defineConfig({
__CALCITE_BUILD_DATE__: JSON.stringify(new Date().toISOString().split("T")[0]),
__CALCITE_REVISION__: JSON.stringify(execSync("git rev-parse --short HEAD", { encoding: "utf-8" }).trim()),
__CALCITE_VERSION__: JSON.stringify(version),
__STORYBOOK_SCREENSHOT_TEST_BUILD__: process.env.STORYBOOK_SCREENSHOT_TEST_BUILD,
},

test: {
Expand Down

0 comments on commit 24a1e99

Please sign in to comment.