mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Merge pull request #28898 from overleaf/ls-send-email-for-tax-exempt-certificate
Send email if tax exempt certificate is required GitOrigin-RevId: 685fec7dbb129eab19095470e681d09423558e4c
This commit is contained in:
@@ -880,6 +880,57 @@ describe('EmailBuilder', function () {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('taxExemptCertificateRequired', function () {
|
||||
beforeEach(function () {
|
||||
this.emailAddress = 'customer@example.com'
|
||||
this.opts = {
|
||||
to: this.emailAddress,
|
||||
ein: '12-3456789',
|
||||
stripeCustomerId: 'cus_123456789',
|
||||
}
|
||||
this.email = this.EmailBuilder.buildEmail(
|
||||
'taxExemptCertificateRequired',
|
||||
this.opts
|
||||
)
|
||||
this.dom = cheerio.load(this.email.html)
|
||||
})
|
||||
|
||||
it('should build the email', function () {
|
||||
expect(this.email.html).to.exist
|
||||
expect(this.email.text).to.exist
|
||||
})
|
||||
|
||||
describe('HTML email', function () {
|
||||
it('should include the EIN', function () {
|
||||
expect(this.email.html).to.contain(this.opts.ein)
|
||||
})
|
||||
|
||||
it('should include the Stripe customer ID', function () {
|
||||
expect(this.email.html).to.contain(this.opts.stripeCustomerId)
|
||||
})
|
||||
|
||||
it('should include tax exemption verification text', function () {
|
||||
expect(this.email.html).to.contain('tax exempt')
|
||||
expect(this.email.html).to.contain('verification')
|
||||
})
|
||||
})
|
||||
|
||||
describe('plain text email', function () {
|
||||
it('should include the EIN', function () {
|
||||
expect(this.email.text).to.contain(this.opts.ein)
|
||||
})
|
||||
|
||||
it('should include the Stripe customer ID', function () {
|
||||
expect(this.email.text).to.contain(this.opts.stripeCustomerId)
|
||||
})
|
||||
|
||||
it('should include tax exemption verification text', function () {
|
||||
expect(this.email.text).to.contain('tax exempt')
|
||||
expect(this.email.text).to.contain('verification')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user