fix tests

This commit is contained in:
Hongbo Wu
2023-10-03 18:13:42 +08:00
parent 3cf0c45fa9
commit 5d35eb3762

View File

@ -329,10 +329,10 @@ describe('Subscriptions API', () => {
id: subscription.id,
})
const deletedSubscription = await getRepository(Subscription).findOneBy({
const updatedSubscription = await getRepository(Subscription).findOneBy({
id: subscription.id,
})
expect(deletedSubscription).to.be.null
expect(updatedSubscription?.status).to.eql(SubscriptionStatus.Unsubscribed)
// check if the email was sent
expect(fake).to.have.been.calledOnceWith({
@ -343,6 +343,9 @@ describe('Subscriptions API', () => {
})
sinon.restore()
// clean up
await getRepository(Subscription).remove(subscription)
})
})
})