[web] fetch token users in a single db query per access mode (#26078)
* [web] skip db query when getting empty list of users * [web] fetch token users in a single db query per access mode GitOrigin-RevId: fa5d9edcb761bd5d5e5ea07d137a5a86efdbdd5c
This commit is contained in:
@@ -119,6 +119,17 @@ describe('UserGetter', function () {
|
||||
})
|
||||
})
|
||||
|
||||
it('should not call mongo with empty list', function (done) {
|
||||
const query = []
|
||||
const projection = { email: 1 }
|
||||
this.UserGetter.getUsers(query, projection, (error, users) => {
|
||||
expect(error).to.not.exist
|
||||
expect(users).to.deep.equal([])
|
||||
expect(this.find).to.not.have.been.called
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('should not allow null query', function (done) {
|
||||
this.UserGetter.getUser(null, {}, error => {
|
||||
error.should.exist
|
||||
|
||||
Reference in New Issue
Block a user