-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add clearAsyncError feature * fix clearAsyncError specs * update clearAsyncError doc
- Loading branch information
1 parent
8ffd57f
commit c22ab5f
Showing
8 changed files
with
75 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { clearAsyncError } from '../actions' | ||
|
||
const describeClearAsyncError = (reducer, expect, { fromJS }) => () => { | ||
it('should do nothing on clear submit with no previous state', () => { | ||
const state = reducer(undefined, clearAsyncError('foo')) | ||
expect(state) | ||
.toEqualMap({ | ||
foo: {} | ||
}) | ||
}) | ||
|
||
it('should clear async errors with previous state', () => { | ||
const state = reducer(fromJS({ | ||
myForm: { | ||
asyncErrors: { | ||
foo: 'some validation message here', | ||
baar: 'second validation message' | ||
} | ||
} | ||
}), clearAsyncError('myForm', 'foo')) | ||
expect(state) | ||
.toEqualMap({ | ||
myForm: { | ||
asyncErrors: { | ||
baar: 'second validation message' | ||
} | ||
} | ||
}) | ||
}) | ||
} | ||
|
||
export default describeClearAsyncError |
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
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