Skip to content

Commit ecf3b20

Browse files
author
Erik Ritter
authored
Only disable chromatic on a single story (#131)
1 parent 2b7b5c7 commit ecf3b20

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/components/src/components/NFTGallery/NFTGallery.stories.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,13 @@ import { NFTGallery } from '.';
55
export default {
66
title: 'Components/NFTGallery',
77
component: NFTGallery,
8-
parameters: {
9-
// TODO: Fix window.ethereum is undefined breaking chromatic
10-
chromatic: { disableSnapshot: true },
11-
},
128
};
139

1410
export const nftsOwnedByAnAccount = () => (
1511
<NFTGallery address='0x1A16c87927570239FECD343ad2654fD81682725e' />
1612
);
1713

18-
export const nftsOwnedByAnENS = () => {
14+
const nftsOwnedByAnENSStory = () => {
1915
const [provider, setProvider] = useState<ethers.providers.Web3Provider>();
2016

2117
useEffect(() => {
@@ -30,4 +26,11 @@ export const nftsOwnedByAnENS = () => {
3026
return <NFTGallery address='dhaiwat.eth' web3Provider={provider} />;
3127
};
3228

29+
export const nftsOwnedByAnENS = nftsOwnedByAnENSStory.bind({});
30+
// @ts-expect-error
31+
nftsOwnedByAnENS.parameters = {
32+
// disables Chromatic's snapshotting on a story level
33+
chromatic: { disableSnapshot: true },
34+
};
35+
3336
export const WithAnError = () => <NFTGallery address='bad_address' />;

0 commit comments

Comments
 (0)