-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Form)!: include nested state in submit data (#3028)
- Loading branch information
Showing
4 changed files
with
21 additions
and
9 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
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 |
---|---|---|
|
@@ -347,6 +347,15 @@ describe('Form', () => { | |
expect(nestedField.text()).toBe('Required') | ||
}) | ||
|
||
test('submit event contains nested attributes', async () => { | ||
state.email = '[email protected]' | ||
state.password = 'strongpassword' | ||
state.nested.field = 'nested' | ||
|
||
await form.value.submit() | ||
expect(wrapper.setupState.onSubmit).toHaveBeenCalledWith(expect.objectContaining({ data: { email: '[email protected]', password: 'strongpassword', nested: { field: 'nested' } } })) | ||
}) | ||
|
||
test('submit works when child is disabled', async () => { | ||
await form.value.submit() | ||
expect(wrapper.setupState.onError).toHaveBeenCalledTimes(1) | ||
|