Skip to content

Commit

Permalink
Tried to reproduce #195
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed Sep 18, 2018
1 parent d4a165b commit 4f27a93
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions __tests__/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,23 @@ function runBaseTest(name, useProxies, freeze, useListener) {
expect(nextState).toEqual([1, 2, 100])
})

it("#195 should be able to find items", () => {
const state = {
items: [
{
id: 0,
task: "drink milk"
},
{id: 1, task: "eat cookie"}
]
}
produce(state, draft => {
expect(draft.items.find(({id}) => id === 1).task).toBe(
"eat cookie"
)
})
})

afterEach(() => {
expect(baseState).toBe(origBaseState)
expect(baseState).toEqual(createBaseState())
Expand Down

0 comments on commit 4f27a93

Please sign in to comment.