From 5b1c0c50082ad4e6748fb77aba246e9c13d07c61 Mon Sep 17 00:00:00 2001 From: andrew rumble Date: Fri, 16 Aug 2024 10:27:36 +0100 Subject: [PATCH] Fix use of fake ObjectIds in tests 12 character strings are no longer valid see: https://github.com/mongodb/js-bson/releases/tag/v6.0.0 (Strings of length 12 can no longer make an ObjectId) GitOrigin-RevId: 2590c10915c50b951f991b2cf161d80235e445ca --- .../test/unit/src/Collaborators/CollaboratorsGetterTests.js | 2 +- .../test/unit/src/Subscription/SubscriptionUpdaterTests.js | 2 +- .../web/test/unit/src/Subscription/TeamInvitesHandlerTests.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/web/test/unit/src/Collaborators/CollaboratorsGetterTests.js b/services/web/test/unit/src/Collaborators/CollaboratorsGetterTests.js index 04e625458d..2bb3e5907c 100644 --- a/services/web/test/unit/src/Collaborators/CollaboratorsGetterTests.js +++ b/services/web/test/unit/src/Collaborators/CollaboratorsGetterTests.js @@ -13,7 +13,7 @@ const MODULE_PATH = Path.join( describe('CollaboratorsGetter', function () { beforeEach(function () { - this.userId = 'mock-user-id' + this.userId = 'efb93a186e9a06f15fea5abd' this.ownerRef = new ObjectId() this.readOnlyRef1 = new ObjectId() this.readOnlyRef2 = new ObjectId() diff --git a/services/web/test/unit/src/Subscription/SubscriptionUpdaterTests.js b/services/web/test/unit/src/Subscription/SubscriptionUpdaterTests.js index d478ad8afe..3d8212201f 100644 --- a/services/web/test/unit/src/Subscription/SubscriptionUpdaterTests.js +++ b/services/web/test/unit/src/Subscription/SubscriptionUpdaterTests.js @@ -307,7 +307,7 @@ describe('SubscriptionUpdater', function () { it('should not remove the subscription when expired if it has Group SSO enabled', async function () { this.Features.hasFeature.withArgs('saas').returns(true) - this.subscription.ssoConfig = new ObjectId('abc123abc123') + this.subscription.ssoConfig = new ObjectId('abc123abc123abc123abc123') this.recurlySubscription.state = 'expired' await this.SubscriptionUpdater.promises.updateSubscriptionFromRecurly( diff --git a/services/web/test/unit/src/Subscription/TeamInvitesHandlerTests.js b/services/web/test/unit/src/Subscription/TeamInvitesHandlerTests.js index f726bdb9cb..0b762823a4 100644 --- a/services/web/test/unit/src/Subscription/TeamInvitesHandlerTests.js +++ b/services/web/test/unit/src/Subscription/TeamInvitesHandlerTests.js @@ -260,7 +260,7 @@ describe('TeamInvitesHandler', function () { }) it('sends an SSO invite if SSO is enabled and inviting self', function (done) { - this.subscription.ssoConfig = new ObjectId('abc123abc123') + this.subscription.ssoConfig = new ObjectId('abc123abc123abc123abc123') this.SSOConfig.findById .withArgs(this.subscription.ssoConfig) .resolves({ enabled: true }) @@ -282,7 +282,7 @@ describe('TeamInvitesHandler', function () { }) it('does not send an SSO invite if SSO is disabled and inviting self', function (done) { - this.subscription.ssoConfig = new ObjectId('abc123abc123') + this.subscription.ssoConfig = new ObjectId('abc123abc123abc123abc123') this.SSOConfig.findById .withArgs(this.subscription.ssoConfig) .resolves({ enabled: false })