Skip to content

Commit 215ab67

Browse files
committed
Integration test for deleteUser
1 parent e885958 commit 215ab67

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/integration/user-store-test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,26 @@ describe('UserStore (integration)', () => {
143143
})
144144
})
145145
})
146+
describe('deleteUser()', () => {
147+
it('deletes a previously saved user', () => {
148+
let options = { path: dbPath, saltRounds: 2 }
149+
let store = UserStore.from(options)
150+
store.initCollections()
151+
152+
let user = {
153+
id: 'alice.example.com',
154+
155+
}
156+
let password = '12345'
157+
158+
return store.createUser(user, password)
159+
.then(() => {
160+
return store.deleteUser(user)
161+
})
162+
.then(foundUser => {
163+
expect(foundUser.id).to.not.exist()
164+
expect(foundUser.email).to.not.exist()
165+
})
166+
})
167+
})
146168
})

0 commit comments

Comments
 (0)