mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 21:01:33 +02:00
Merge pull request #3495 from overleaf/ae-prettier-2
Upgrade Prettier to v2 GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
@@ -5,16 +5,16 @@ const { expect } = require('chai')
|
||||
|
||||
const modulePath = `${APP_ROOT}/Features/SamlLog/SamlLogHandler`
|
||||
|
||||
describe('SamlLogHandler', function() {
|
||||
describe('SamlLogHandler', function () {
|
||||
let SamlLog, SamlLogHandler, SamlLogModel
|
||||
|
||||
let data, providerId, samlLog, sessionId
|
||||
|
||||
beforeEach(function() {
|
||||
beforeEach(function () {
|
||||
samlLog = {
|
||||
save: sinon.stub()
|
||||
}
|
||||
SamlLog = function() {
|
||||
SamlLog = function () {
|
||||
return samlLog
|
||||
}
|
||||
SamlLogModel = { SamlLog }
|
||||
@@ -29,12 +29,12 @@ describe('SamlLogHandler', function() {
|
||||
sessionId = 'session-id'
|
||||
})
|
||||
|
||||
describe('with valid data object', function() {
|
||||
beforeEach(function() {
|
||||
describe('with valid data object', function () {
|
||||
beforeEach(function () {
|
||||
SamlLogHandler.log(providerId, sessionId, data)
|
||||
})
|
||||
|
||||
it('should log data', function() {
|
||||
it('should log data', function () {
|
||||
samlLog.providerId.should.equal(providerId)
|
||||
samlLog.sessionId.should.equal(sessionId.substr(0, 8))
|
||||
samlLog.jsonData.should.equal('{"foo":true}')
|
||||
@@ -43,15 +43,15 @@ describe('SamlLogHandler', function() {
|
||||
})
|
||||
})
|
||||
|
||||
describe('when a json stringify error occurs', function() {
|
||||
beforeEach(function() {
|
||||
describe('when a json stringify error occurs', function () {
|
||||
beforeEach(function () {
|
||||
const circularRef = {}
|
||||
circularRef.circularRef = circularRef
|
||||
|
||||
SamlLogHandler.log(providerId, sessionId, circularRef)
|
||||
})
|
||||
|
||||
it('should log without data and log error', function() {
|
||||
it('should log without data and log error', function () {
|
||||
samlLog.providerId.should.equal(providerId)
|
||||
samlLog.sessionId.should.equal(sessionId.substr(0, 8))
|
||||
expect(samlLog.data).to.be.undefined
|
||||
@@ -64,14 +64,14 @@ describe('SamlLogHandler', function() {
|
||||
})
|
||||
})
|
||||
|
||||
describe('when logging error occurs', function() {
|
||||
beforeEach(function() {
|
||||
describe('when logging error occurs', function () {
|
||||
beforeEach(function () {
|
||||
samlLog.save = sinon.stub().yields('error')
|
||||
|
||||
SamlLogHandler.log(providerId, sessionId, data)
|
||||
})
|
||||
|
||||
it('should log error', function() {
|
||||
it('should log error', function () {
|
||||
this.logger.error.should.have.been.calledOnce.and.calledWithMatch(
|
||||
{ err: 'error', providerId, sessionId: sessionId.substr(0, 8) },
|
||||
'SamlLog Error'
|
||||
|
||||
Reference in New Issue
Block a user