|
@@ -97,20 +97,22 @@ describe('ProjectEditorHandler', function() {
|
|
|
_id: 'invite_one',
|
|
_id: 'invite_one',
|
|
|
email: 'user-one@example.com',
|
|
email: 'user-one@example.com',
|
|
|
privileges: 'readOnly',
|
|
privileges: 'readOnly',
|
|
|
- projectId: this.project._id
|
|
|
|
|
|
|
+ projectId: this.project._id,
|
|
|
|
|
+ token: 'my-secret-token1'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
_id: 'invite_two',
|
|
_id: 'invite_two',
|
|
|
email: 'user-two@example.com',
|
|
email: 'user-two@example.com',
|
|
|
privileges: 'readOnly',
|
|
privileges: 'readOnly',
|
|
|
- projectId: this.project._id
|
|
|
|
|
|
|
+ projectId: this.project._id,
|
|
|
|
|
+ token: 'my-secret-token2'
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
return (this.handler = SandboxedModule.require(modulePath))
|
|
return (this.handler = SandboxedModule.require(modulePath))
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
describe('buildProjectModelView', function() {
|
|
describe('buildProjectModelView', function() {
|
|
|
- describe('with owner and members included', function() {
|
|
|
|
|
|
|
+ describe('with owner, members and invites included', function() {
|
|
|
beforeEach(function() {
|
|
beforeEach(function() {
|
|
|
return (this.result = this.handler.buildProjectModelView(
|
|
return (this.result = this.handler.buildProjectModelView(
|
|
|
this.project,
|
|
this.project,
|
|
@@ -159,6 +161,11 @@ describe('ProjectEditorHandler', function() {
|
|
|
])
|
|
])
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ it('invites should not include the token', function() {
|
|
|
|
|
+ should.not.exist(this.result.invites[0].token)
|
|
|
|
|
+ should.not.exist(this.result.invites[1].token)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
it('should gather readOnly_refs and collaberators_refs into a list of members', function() {
|
|
it('should gather readOnly_refs and collaberators_refs into a list of members', function() {
|
|
|
const findMember = id => {
|
|
const findMember = id => {
|
|
|
for (let member of Array.from(this.result.members)) {
|
|
for (let member of Array.from(this.result.members)) {
|