mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
e2e: add email check step to chat notification test
This commit is contained in:
parent
ad1ee8b739
commit
df6ea0e1f4
@ -28,8 +28,8 @@ Feature: Notifications for Chat Messages via E-Mail
|
||||
When I am logged in as "billy-block"
|
||||
And I send a chat message to "Anna Absent"
|
||||
And I log out
|
||||
# Then "Anna Absent" should receive "1" chat notification email referencing "Chilly Chatter"
|
||||
# When I am logged in as "anna-absent"
|
||||
Then "Anna Absent" should receive "1" chat notification email referencing "Chilly Chatter"
|
||||
When I am logged in as "anna-absent"
|
||||
# And "Chilly Chatter" sends a chat message to "Anna Absent"
|
||||
# And "Michi Mute" sends a chat message to "Anna Absent"
|
||||
# And "Billy Block" sends a chat message to "Anna Absent"
|
||||
|
||||
@ -9,6 +9,24 @@ defineStep('the mailserver inbox is empty', () => {
|
||||
.should('equal', 200)
|
||||
})
|
||||
|
||||
defineStep('{string} should receive {string} chat notification email referencing {string}', (recipientName, emailCount, senderName) => {
|
||||
cy.request('GET', 'http://localhost:1080/email').then(
|
||||
(response) => {
|
||||
expect(response.status).to.eq(200)
|
||||
cy.log(response.body)
|
||||
console.log
|
||||
expect(response.body).to.have.length(emailCount)
|
||||
const email = response.body[0]
|
||||
expect(email.read).to.be.false
|
||||
expect(email.subject).to.eq('ocelot.social – Notification: New chat message')
|
||||
const assertedString = `Hello ${recipientName}`
|
||||
expect(email.text.toLowerCase()).to.include(assertedString.toLowerCase())
|
||||
expect(email.text).to.include(`from ${senderName}`)
|
||||
expect(email.html).to.include('/chat')
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
defineStep('{string} should receive no chat notification email', (recipientEmailAddress) => {
|
||||
const emailTitle = 'Neue Chat-Nachricht | New chat message'
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user