Skip to content

Commit

Permalink
[Fix] Stabilize snapshots (#10774)
Browse files Browse the repository at this point in the history
* hardcode vars for storybook

* format code to force snapshot change
  • Loading branch information
esizer authored Jun 25, 2024
1 parent 1ed0a49 commit f08585e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions apps/web/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ const Footer = ({ width }: FooterProps) => {
}),
},
];

let footerWidth = {
"data-h2-container": "base(center, large, x1) p-tablet(center, large, x2)",
};

if (width === "full") {
footerWidth = {
"data-h2-container": "base(center, full, x1) p-tablet(center, full, x2)",
Expand Down
14 changes: 13 additions & 1 deletion packages/storybook-helpers/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,20 @@ const main: StorybookConfig = {
// REF: https://stackoverflow.com/questions/77540892/chromatic-github-action-is-failing
viteFinal(config) {
config.plugins = (config.plugins ?? []).filter(
(plugin) => plugin && "name" in plugin && plugin.name !== "vite:dts",
(plugin) =>
plugin &&
"name" in plugin &&
plugin.name !== "vite:dts" &&
// Filter out git version plugin to hardcode for
// Stable snapshots
plugin.name !== "git-version",
);
config.define = {
...config.define,
// Hardcode vars for stable snapshots
BUILD_DATE: JSON.stringify("1970-01-01"),
VERSION: JSON.stringify("v1.0.0"),
};
return config;
},
};
Expand Down

0 comments on commit f08585e

Please sign in to comment.