Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
Update view as part of mock.simulate
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverviljamaa committed Nov 30, 2018
1 parent cbc3960 commit c73a1fd
Show file tree
Hide file tree
Showing 6 changed files with 1,911 additions and 1,902 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v1.2.1
## Update view as part of `mock.simulate`

Previously, the `.simulate` call of `mock` did not update the view, requiring the test to inject `$scope` or `$rootScope` to `$apply` or `$digest` in order to test view changes.
This is now fixed and the fact that `.simulate` updates the view for both `mock` and `TestElementWrapper` is reflected in the documentation.

# v1.2.0
## Add `.first` to `TestElementWrapper`

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ it('has transferwise link', () => {

#### `.simulate(event[, data]) => Self`

Calls an event handler on the wrapper for passed `event` with `data` (optional) and returns wrapper for chaining.
Calls an event handler on the wrapper for passed `event` with `data` (optional), updates the view, and returns wrapper for chaining.

NOTE: `event` should be written in camelCase and without the `on` present in the event handler name. Currently, `change` and `click` events are supported, with `change` requiring an event format.

Expand Down Expand Up @@ -508,7 +508,7 @@ it('passes some prop to child component', () => {

#### `.simulate(event[, data]) => Self`

Calls an event handler on the mocked component for passed `event` with `data` (optional) and returns mocked component for chaining.
Calls an event handler on the mocked component for passed `event` with `data` (optional), updates the view, and returns mocked component for chaining.

NOTE: `event` should be written in camelCase and without the `on` present in the event handler name. So, to call `onSomePropChange`, `.simulate('somePropChange')` should be used.

Expand Down
Loading

0 comments on commit c73a1fd

Please sign in to comment.