mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 13:49:00 +02:00
Merge pull request #3495 from overleaf/ae-prettier-2
Upgrade Prettier to v2 GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
@@ -6,8 +6,8 @@ const { User } = require('../helpers/models/User')
|
||||
|
||||
const MODULE_PATH = '../../../../app/src/Features/User/UserAuditLogHandler'
|
||||
|
||||
describe('UserAuditLogHandler', function() {
|
||||
beforeEach(function() {
|
||||
describe('UserAuditLogHandler', function () {
|
||||
beforeEach(function () {
|
||||
this.userId = ObjectId()
|
||||
this.initiatorId = ObjectId()
|
||||
this.action = {
|
||||
@@ -31,18 +31,18 @@ describe('UserAuditLogHandler', function() {
|
||||
})
|
||||
})
|
||||
|
||||
afterEach(function() {
|
||||
afterEach(function () {
|
||||
this.UserMock.restore()
|
||||
})
|
||||
|
||||
describe('addEntry', function() {
|
||||
describe('success', function() {
|
||||
beforeEach(function() {
|
||||
describe('addEntry', function () {
|
||||
describe('success', function () {
|
||||
beforeEach(function () {
|
||||
this.dbUpdate = this.UserMock.expects('updateOne')
|
||||
.chain('exec')
|
||||
.resolves({ nModified: 1 })
|
||||
})
|
||||
it('writes a log', async function() {
|
||||
it('writes a log', async function () {
|
||||
await this.UserAuditLogHandler.promises.addEntry(
|
||||
this.userId,
|
||||
this.action.operation,
|
||||
@@ -53,7 +53,7 @@ describe('UserAuditLogHandler', function() {
|
||||
this.UserMock.verify()
|
||||
})
|
||||
|
||||
it('updates the log for password reset operation witout a initiatorId', async function() {
|
||||
it('updates the log for password reset operation witout a initiatorId', async function () {
|
||||
await expect(
|
||||
this.UserAuditLogHandler.promises.addEntry(
|
||||
this.userId,
|
||||
@@ -67,15 +67,15 @@ describe('UserAuditLogHandler', function() {
|
||||
})
|
||||
})
|
||||
|
||||
describe('errors', function() {
|
||||
describe('when the user does not exist', function() {
|
||||
beforeEach(function() {
|
||||
describe('errors', function () {
|
||||
describe('when the user does not exist', function () {
|
||||
beforeEach(function () {
|
||||
this.UserMock.expects('updateOne')
|
||||
.chain('exec')
|
||||
.resolves({ nModified: 0 })
|
||||
})
|
||||
|
||||
it('throws an error', async function() {
|
||||
it('throws an error', async function () {
|
||||
await expect(
|
||||
this.UserAuditLogHandler.promises.addEntry(
|
||||
this.userId,
|
||||
@@ -88,8 +88,8 @@ describe('UserAuditLogHandler', function() {
|
||||
})
|
||||
})
|
||||
|
||||
describe('missing parameters', function() {
|
||||
it('throws an error when no operation', async function() {
|
||||
describe('missing parameters', function () {
|
||||
it('throws an error when no operation', async function () {
|
||||
await expect(
|
||||
this.UserAuditLogHandler.promises.addEntry(
|
||||
this.userId,
|
||||
@@ -101,7 +101,7 @@ describe('UserAuditLogHandler', function() {
|
||||
).to.be.rejected
|
||||
})
|
||||
|
||||
it('throws an error when no IP', async function() {
|
||||
it('throws an error when no IP', async function () {
|
||||
await expect(
|
||||
this.UserAuditLogHandler.promises.addEntry(
|
||||
this.userId,
|
||||
@@ -113,7 +113,7 @@ describe('UserAuditLogHandler', function() {
|
||||
).to.be.rejected
|
||||
})
|
||||
|
||||
it('throws an error when no initiatorId and not a password reset operation', async function() {
|
||||
it('throws an error when no initiatorId and not a password reset operation', async function () {
|
||||
await expect(
|
||||
this.UserAuditLogHandler.promises.addEntry(
|
||||
this.userId,
|
||||
|
||||
Reference in New Issue
Block a user