mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Fix tests, Cont
This commit is contained in:
parent
f286a89a5f
commit
87efb85a6e
1 changed files with 13 additions and 18 deletions
|
|
@ -25,12 +25,6 @@ describe('Emails Router', () => {
|
|||
|
||||
await createTestNewsletterEmail(user, newsletterEmail)
|
||||
token = process.env.PUBSUB_VERIFICATION_TOKEN!
|
||||
sinon.replace(
|
||||
sendNotification,
|
||||
'sendMulticastPushNotifications',
|
||||
sinon.fake.resolves(undefined)
|
||||
)
|
||||
sinon.replace(sendEmail, 'sendEmail', sinon.fake.resolves(true))
|
||||
})
|
||||
|
||||
after(async () => {
|
||||
|
|
@ -45,15 +39,24 @@ describe('Emails Router', () => {
|
|||
const subject = 'test subject'
|
||||
const html = 'test html'
|
||||
|
||||
beforeEach(async () => {
|
||||
sinon.replace(
|
||||
sendNotification,
|
||||
'sendMulticastPushNotifications',
|
||||
sinon.fake.resolves(undefined)
|
||||
)
|
||||
sinon.replace(sendEmail, 'sendEmail', sinon.fake.resolves(true))
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
sinon.restore()
|
||||
})
|
||||
|
||||
context('when email is a newsletter', () => {
|
||||
before(() => {
|
||||
sinon.replace(parser, 'isProbablyNewsletter', sinon.fake.resolves(true))
|
||||
})
|
||||
|
||||
after(() => {
|
||||
sinon.restore()
|
||||
})
|
||||
|
||||
it('saves the email as a newsletter', async () => {
|
||||
const data = {
|
||||
message: {
|
||||
|
|
@ -81,10 +84,6 @@ describe('Emails Router', () => {
|
|||
sinon.replace(parser, 'isProbablyArticle', sinon.fake.resolves(true))
|
||||
})
|
||||
|
||||
after(() => {
|
||||
sinon.restore()
|
||||
})
|
||||
|
||||
it('saves the email as an article', async () => {
|
||||
const data = {
|
||||
message: {
|
||||
|
|
@ -112,10 +111,6 @@ describe('Emails Router', () => {
|
|||
sinon.replace(parser, 'isProbablyArticle', sinon.fake.resolves(false))
|
||||
})
|
||||
|
||||
after(() => {
|
||||
sinon.restore()
|
||||
})
|
||||
|
||||
it('forwards the email', async () => {
|
||||
const data = {
|
||||
message: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue