-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ad UI 9399 fix get input props (#3602)
* chore(mantine): bump to mantine v7, first commit rebasing * chore(mantine): lots of css modules, preparing theme and components rebasing * chore(mantine)!: more breaking stuff * chore(mantine)!: more module, less v6, build working * chore(mantine)!: trying to style my branch so it looks 1:1 with master * chore(mantine)!: apply some visual fixes to look like prod * chore(mantine)!: fixed table style and rows * chore(mantine)!: fixed all the rest style expect table gutter grid * chore(mantine)!: fix interfaces and remove comments * chore(useForm)!: change condition in useform hook * chore(useForm)!: fixed collection demo * chore(useForm): fixed ternary and faker-js * chore(useForm): removed console.log * chore(useForm)!: fix unit test
- Loading branch information
1 parent
f00b29b
commit 13f08e4
Showing
5 changed files
with
87 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {renderHook} from '../../__tests__/Utils'; | ||
import {useForm} from '../useForm'; | ||
|
||
describe('useForm', () => { | ||
it("returns 'onReorderItem', 'onRemoveItem' & 'onInsertItem' if the form is 'collection' type", () => { | ||
const view = renderHook(() => useForm({initialValues: {fruits: ['banana', 'orange']}})); | ||
|
||
const propsTypeCollection = view.result.current.getInputProps('fruits', {type: 'collection'}); | ||
expect(typeof propsTypeCollection.onReorderItem).toBe('function'); | ||
expect(typeof propsTypeCollection.onRemoveItem).toBe('function'); | ||
expect(typeof propsTypeCollection.onInsertItem).toBe('function'); | ||
|
||
const propsNotCollection = view.result.current.getInputProps('fruits'); | ||
expect(typeof propsNotCollection.onReorderItem).toBe('undefined'); | ||
expect(typeof propsNotCollection.onRemoveItem).toBe('undefined'); | ||
expect(typeof propsNotCollection.onInsertItem).toBe('undefined'); | ||
}); | ||
}); |
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