-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: show e-mail in subline of e-mail guests for moderators
- show e-mail in toast when resend invitation - refactor tests Signed-off-by: Maksim Sukharev <[email protected]>
- Loading branch information
Showing
2 changed files
with
32 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -227,39 +227,43 @@ describe('Participant.vue', () => { | |
/** | ||
* Check which status is currently rendered | ||
* @param {object} participant participant object | ||
* @param {string|null} status status which expected to be rendered | ||
* @param {string} [status] status which expected to be rendered | ||
*/ | ||
async function checkUserSubnameRendered(participant, status) { | ||
const wrapper = mountParticipant(participant) | ||
await flushPromises() | ||
const userSubname = wrapper.find('.participant__status') | ||
if (status) { | ||
expect(wrapper.find('.participant__status').exists()).toBeTruthy() | ||
expect(wrapper.find('.participant__status').text()).toBe(status) | ||
expect(userSubname.exists()).toBeTruthy() | ||
expect(userSubname.text()).toBe(status) | ||
} else { | ||
expect(wrapper.find('.participant__status').exists()).toBeFalsy() | ||
expect(userSubname.exists()).toBeFalsy() | ||
} | ||
} | ||
|
||
test('renders user status', async () => { | ||
await checkUserSubnameRendered(participant, '🌧️ rainy') | ||
}) | ||
|
||
test('does not render user status when not set', async () => { | ||
participant.statusIcon = '' | ||
participant.statusMessage = '' | ||
await checkUserSubnameRendered(participant, null) | ||
}) | ||
const testCases = [ | ||
['online', '', '', undefined], | ||
['online', '🌧️', 'Rainy', '🌧️ Rainy'], | ||
['dnd', '🌧️', 'Rainy', '🌧️ Rainy'], | ||
['dnd', '🌧️', '', '🌧️ Do not disturb'], | ||
['away', '🌧️', '', '🌧️ Away'], | ||
] | ||
|
||
test('renders dnd status', async () => { | ||
participant.statusMessage = '' | ||
participant.status = 'dnd' | ||
await checkUserSubnameRendered(participant, '🌧️ Do not disturb') | ||
}) | ||
it.each(testCases)('renders status for participant \'%s\', \'%s\', \'%s\' - \'%s\'', | ||
(status, statusIcon, statusMessage, result) => { | ||
checkUserSubnameRendered({ | ||
...participant, | ||
status, | ||
statusIcon, | ||
statusMessage, | ||
}, result) | ||
}) | ||
|
||
test('renders away status', async () => { | ||
participant.statusMessage = '' | ||
participant.status = 'away' | ||
await checkUserSubnameRendered(participant, '🌧️ Away') | ||
it('renders e-mail as status for e-mail guest', async () => { | ||
participant.actorType = ATTENDEE.ACTOR_TYPE.EMAILS | ||
participant.participantType = PARTICIPANT.TYPE.GUEST | ||
participant.invitedActorId = '[email protected]' | ||
await checkUserSubnameRendered(participant, '[email protected]') | ||
}) | ||
}) | ||
|
||
|
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