-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Quentin LE CAIGNEC
committed
Sep 5, 2024
1 parent
0ef57a7
commit 6652f09
Showing
4 changed files
with
643 additions
and
97 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
27 changes: 27 additions & 0 deletions
27
packages/haring-react/src/Form/DynamicZone/DynamicZone.test.tsx
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,27 @@ | ||
import type { IBaseBlock } from '../../types'; | ||
import type { ReactElement } from 'react'; | ||
|
||
import { renderWithProviders } from '@smile/haring-react-shared/test-utils'; | ||
import { action } from '@storybook/addon-actions'; | ||
import { expect } from '@storybook/jest'; | ||
|
||
import { DynamicZone } from './DynamicZone'; | ||
import { dynamicZoneBlocks, dynamicZoneButtons } from './DynamicZone.mock'; | ||
|
||
describe('DynamicZone', () => { | ||
it('matches snapshot', () => { | ||
const onRender = (_b: IBaseBlock, index: number): ReactElement => ( | ||
<input key={index} /> | ||
); | ||
const { container } = renderWithProviders( | ||
<DynamicZone | ||
blockOptions={dynamicZoneButtons} | ||
blocks={dynamicZoneBlocks} | ||
onAppendBlock={action('onAppendBlock, id')} | ||
onRenderBlockContent={onRender} | ||
onToggleBlock={action('onToggleBlock')} | ||
/>, | ||
); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.