-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' into remove-presence-samples
- Loading branch information
Showing
9 changed files
with
238 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -262,5 +262,100 @@ describe('plugin-meetings', () => { | |
testParams(false); | ||
}); | ||
}); | ||
|
||
describe('#getAddMemberBody', () => { | ||
it('returns the correct body with email address and roles', () => { | ||
const options = { | ||
invitee: { | ||
emailAddress: '[email protected]', | ||
roles: ['role1', 'role2'], | ||
}, | ||
alertIfActive: true, | ||
}; | ||
|
||
assert.deepEqual(MembersUtil.getAddMemberBody(options), { | ||
invitees: [ | ||
{ | ||
address: '[email protected]', | ||
roles: ['role1', 'role2'], | ||
}, | ||
], | ||
alertIfActive: true, | ||
}); | ||
}); | ||
|
||
it('returns the correct body with phone number and no roles', () => { | ||
const options = { | ||
invitee: { | ||
phoneNumber: '1234567890', | ||
}, | ||
alertIfActive: false, | ||
}; | ||
|
||
assert.deepEqual(MembersUtil.getAddMemberBody(options), { | ||
invitees: [ | ||
{ | ||
address: '1234567890', | ||
}, | ||
], | ||
alertIfActive: false, | ||
}); | ||
}); | ||
|
||
it('returns the correct body with fallback to email', () => { | ||
const options = { | ||
invitee: { | ||
email: '[email protected]', | ||
}, | ||
alertIfActive: true, | ||
}; | ||
|
||
assert.deepEqual(MembersUtil.getAddMemberBody(options), { | ||
invitees: [ | ||
{ | ||
address: '[email protected]', | ||
}, | ||
], | ||
alertIfActive: true, | ||
}); | ||
}); | ||
|
||
it('handles missing `alertIfActive` gracefully', () => { | ||
const options = { | ||
invitee: { | ||
emailAddress: '[email protected]', | ||
roles: ['role1'], | ||
}, | ||
}; | ||
|
||
assert.deepEqual(MembersUtil.getAddMemberBody(options), { | ||
invitees: [ | ||
{ | ||
address: '[email protected]', | ||
roles: ['role1'], | ||
}, | ||
], | ||
alertIfActive: undefined, | ||
}); | ||
}); | ||
|
||
it('ignores roles if not provided', () => { | ||
const options = { | ||
invitee: { | ||
emailAddress: '[email protected]', | ||
}, | ||
alertIfActive: false, | ||
}; | ||
|
||
assert.deepEqual(MembersUtil.getAddMemberBody(options), { | ||
invitees: [ | ||
{ | ||
address: '[email protected]', | ||
}, | ||
], | ||
alertIfActive: false, | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters