fix unit tests

GitOrigin-RevId: 34b2aad1b2f4a59909265b60e415d31fd178e9ee
This commit is contained in:
Ersun Warncke
2019-12-18 14:41:38 -04:00
committed by Copybot
parent 58077c4eff
commit c2eb3c1caa
2 changed files with 16 additions and 8 deletions

View File

@@ -45,7 +45,7 @@ describe('SamlLogHandler', function() {
it('should log data', function() {
samlLog.providerId.should.equal(providerId)
samlLog.sessionId.should.equal(sessionId)
samlLog.sessionId.should.equal(sessionId.substr(0, 8))
samlLog.jsonData.should.equal('{"foo":true}')
expect(samlLog.data).to.be.undefined
samlLog.save.should.have.been.calledOnce
@@ -62,12 +62,12 @@ describe('SamlLogHandler', function() {
it('should log without data and log error', function() {
samlLog.providerId.should.equal(providerId)
samlLog.sessionId.should.equal(sessionId)
samlLog.sessionId.should.equal(sessionId.substr(0, 8))
expect(samlLog.data).to.be.undefined
expect(samlLog.jsonData).to.be.undefined
samlLog.save.should.have.been.calledOnce
LoggerSharelatex.error.should.have.been.calledOnce.and.calledWithMatch(
{ providerId, sessionId },
{ providerId, sessionId: sessionId.substr(0, 8) },
'SamlLog JSON.stringify Error'
)
})
@@ -82,7 +82,7 @@ describe('SamlLogHandler', function() {
it('should log error', function() {
LoggerSharelatex.error.should.have.been.calledOnce.and.calledWithMatch(
{ err: 'error', providerId, sessionId },
{ err: 'error', providerId, sessionId: sessionId.substr(0, 8) },
'SamlLog Error'
)
})