-
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
Aug 27, 2024
1 parent
c314a74
commit ac486c8
Showing
7 changed files
with
229 additions
and
24 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
packages/haring-react-hook-form/src/Components/FormDynamicZone/FormDynamicZone.mock.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,7 @@ | ||
import { Alien, Leaf, TreasureChest } from '@phosphor-icons/react'; | ||
|
||
export const blockOptionsMock = [ | ||
{ id: 'default', label: 'Default', leftSection: <Alien /> }, | ||
{ id: 'other', label: 'Other', leftSection: <Leaf /> }, | ||
{ id: 'stuff', label: 'Stuff', leftSection: <TreasureChest /> }, | ||
]; |
22 changes: 22 additions & 0 deletions
22
packages/haring-react-hook-form/src/Components/FormDynamicZone/FormDynamicZone.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,22 @@ | ||
import type { ReactElement } from 'react'; | ||
|
||
import { renderWithProviders } from '@smile/haring-react-shared/test-utils'; | ||
import { FormProvider, useForm } from 'react-hook-form'; | ||
|
||
import { FormDynamicZone } from './FormDynamicZone'; | ||
|
||
describe('FormDynamicZone', () => { | ||
it('matches snapshot', () => { | ||
function TestWithProvider(): ReactElement { | ||
const methods = useForm(); | ||
return ( | ||
<FormProvider {...methods}> | ||
<FormDynamicZone dynamicZoneName="dynamicZoneTest" /> | ||
</FormProvider> | ||
); | ||
} | ||
|
||
const { container } = renderWithProviders(<TestWithProvider />); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); |
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
172 changes: 172 additions & 0 deletions
172
...eact-hook-form/src/Components/FormDynamicZone/__snapshots__/FormDynamicZone.test.tsx.snap
Large diffs are not rendered by default.
Oops, something went wrong.
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
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