mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #3750 from overleaf/jpa-req-ip-in-unit-tests
[misc] test/unit: add req.ip to MockRequest helper GitOrigin-RevId: 07b1cf11f20eccb4c002a21f4a59588d201a3f0c
This commit is contained in:
parent
4280a96b2c
commit
0ca9d0236c
2 changed files with 2 additions and 1 deletions
|
@ -68,7 +68,7 @@ describe('AuthenticationController', function() {
|
||||||
hooks: { fire: sinon.stub().yields(null, []) }
|
hooks: { fire: sinon.stub().yields(null, []) }
|
||||||
}),
|
}),
|
||||||
'../Notifications/NotificationsBuilder': (this.NotificationsBuilder = {
|
'../Notifications/NotificationsBuilder': (this.NotificationsBuilder = {
|
||||||
ipMatcherAffiliation: sinon.stub()
|
ipMatcherAffiliation: sinon.stub().returns({ create: sinon.stub() })
|
||||||
}),
|
}),
|
||||||
'../../models/User': { User: this.UserModel },
|
'../../models/User': { User: this.UserModel },
|
||||||
'../../../../modules/oauth2-server/app/src/Oauth2Server': (this.Oauth2Server = {
|
'../../../../modules/oauth2-server/app/src/Oauth2Server': (this.Oauth2Server = {
|
||||||
|
|
|
@ -9,6 +9,7 @@ class MockRequest {
|
||||||
static initClass() {
|
static initClass() {
|
||||||
this.prototype.session = { destroy() {} }
|
this.prototype.session = { destroy() {} }
|
||||||
|
|
||||||
|
this.prototype.ip = '42.42.42.42'
|
||||||
this.prototype.headers = {}
|
this.prototype.headers = {}
|
||||||
this.prototype.params = {}
|
this.prototype.params = {}
|
||||||
this.prototype.query = {}
|
this.prototype.query = {}
|
||||||
|
|
Loading…
Reference in a new issue