mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Merge pull request #34330 from overleaf/jel-web-save-captured_by_group
[web] Send email alert when domain is captured or not GitOrigin-RevId: 5554d82653be3226e5d72a0e42ca8aaa9a9b8f41
This commit is contained in:
@@ -14,6 +14,7 @@ describe('EmailBuilder', function () {
|
||||
ctx.settings = {
|
||||
appName: 'testApp',
|
||||
siteUrl: 'https://www.overleaf.com',
|
||||
adminEmail: 'admin@overleaf.test',
|
||||
}
|
||||
|
||||
vi.doMock('../../../../app/src/Features/Email/EmailMessageHelper', () => ({
|
||||
@@ -963,6 +964,50 @@ describe('EmailBuilder', function () {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('groupDomainCapturedByGroupChanged', function () {
|
||||
it('should build active-domain-capture email', function (ctx) {
|
||||
const email = ctx.EmailBuilder.buildEmail(
|
||||
'groupDomainCapturedByGroupChanged',
|
||||
{
|
||||
to: 'admin@example.com',
|
||||
groupId: 'group-123',
|
||||
domainCapturedByGroup: true,
|
||||
domain: 'example.com',
|
||||
}
|
||||
)
|
||||
|
||||
expect(email.subject).to.equal(
|
||||
'Domain capture now active for example.com'
|
||||
)
|
||||
expect(email.html).to.contain(
|
||||
'Domain capture is active for example.com'
|
||||
)
|
||||
expect(email.html).to.contain('/manage/groups/group-123/settings')
|
||||
expect(email.text).to.contain('/manage/groups/group-123/settings')
|
||||
})
|
||||
|
||||
it('should build inactive-domain-capture email including support contact', function (ctx) {
|
||||
const email = ctx.EmailBuilder.buildEmail(
|
||||
'groupDomainCapturedByGroupChanged',
|
||||
{
|
||||
to: 'admin@example.com',
|
||||
groupId: 'group-123',
|
||||
domainCapturedByGroup: false,
|
||||
domain: 'example.com',
|
||||
}
|
||||
)
|
||||
|
||||
expect(email.subject).to.equal(
|
||||
'Domain capture now inactive for example.com'
|
||||
)
|
||||
expect(email.html).to.contain(
|
||||
'Domain capture is inactive for example.com'
|
||||
)
|
||||
expect(email.html).to.contain('admin@overleaf.test')
|
||||
expect(email.text).to.contain('admin@overleaf.test')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user