[saas-e2e] Delete user subscriptions in e2e tests setup (#27867)

Address errors caused by https://github.com/overleaf/internal/pull/27746

GitOrigin-RevId: 461ea586622999f8680f3f5eddcae71ffb6642c7
This commit is contained in:
Antoine Clausse
2025-08-13 12:36:50 +02:00
committed by Copybot
parent 95014d005a
commit ec98e68cab

View File

@@ -51,6 +51,8 @@ async function createUser(email) {
async function deleteUser(email) {
const user = await db.users.findOne({ email })
if (!user) return
// Delete the subscriptions of the user
await db.subscriptions.deleteMany({ admin_id: user._id })
// Soft delete the user.
await UserDeleter.promises.deleteUser(user._id, {
force: true,