Skip to content

Commit

Permalink
test: Prepare test for #58 (findOrAdd event issue)
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Jul 24, 2015
1 parent 87ec32c commit a8368bf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/specs/find-or-add.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,25 @@ test('store.findOrAdd([object1, object2])', function (t) {
})
})
})

test.skip('#58 store.findOrAdd(id, object) triggers no events when finds existing', function (t) {
t.plan(1)

var db = dbFactory()
var store = db.hoodieApi()
var triggeredEvents = false

store.on('add', function () {
triggeredEvents = true
})

store.add({id: 'exists', foo: 'bar'})

.then(function () {
return store.findOrAdd('exists', {foo: 'baz'})
})

.then(function () {
t.is(triggeredEvents, false, 'triggers no events')
})
})

0 comments on commit a8368bf

Please sign in to comment.