mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 06:09:02 +02:00
Merge pull request #2081 from overleaf/cmg-per-user-trash
Add per-user trashed state to project model GitOrigin-RevId: 16a753702d3503eee011dd2adca5dc8df3da87f4
This commit is contained in:
committed by
sharelatex
parent
c1f8ac8de1
commit
6f2b4d3da3
@@ -68,6 +68,43 @@ describe('ProjectHelper', function() {
|
||||
).to.equal(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('project.archived being undefined', function() {
|
||||
it('returns false if archived is undefined', function() {
|
||||
this.project.archived = undefined
|
||||
expect(
|
||||
this.ProjectHelper.isArchived(this.project, this.user._id)
|
||||
).to.equal(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('isTrashed', function() {
|
||||
it('returns true if user id is found', function() {
|
||||
this.project.trashed = [
|
||||
ObjectId('588f3ddae8ebc1bac07c9fa4'),
|
||||
ObjectId('5c41deb2b4ca500153340809')
|
||||
]
|
||||
expect(
|
||||
this.ProjectHelper.isTrashed(this.project, this.user._id)
|
||||
).to.equal(true)
|
||||
})
|
||||
|
||||
it('returns false if user id is not found', function() {
|
||||
this.project.trashed = []
|
||||
expect(
|
||||
this.ProjectHelper.isTrashed(this.project, this.user._id)
|
||||
).to.equal(false)
|
||||
})
|
||||
|
||||
describe('project.trashed being undefined', function() {
|
||||
it('returns false if trashed is undefined', function() {
|
||||
this.project.trashed = undefined
|
||||
expect(
|
||||
this.ProjectHelper.isTrashed(this.project, this.user._id)
|
||||
).to.equal(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('compilerFromV1Engine', function() {
|
||||
|
||||
Reference in New Issue
Block a user