Kaynağa Gözat

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
andrew rumble 2 yıl önce
ebeveyn
işleme
5b1c0c5008

+ 1 - 1
services/web/test/unit/src/Collaborators/CollaboratorsGetterTests.js

@@ -13,7 +13,7 @@ const MODULE_PATH = Path.join(
 
 
 describe('CollaboratorsGetter', function () {
 describe('CollaboratorsGetter', function () {
   beforeEach(function () {
   beforeEach(function () {
-    this.userId = 'mock-user-id'
+    this.userId = 'efb93a186e9a06f15fea5abd'
     this.ownerRef = new ObjectId()
     this.ownerRef = new ObjectId()
     this.readOnlyRef1 = new ObjectId()
     this.readOnlyRef1 = new ObjectId()
     this.readOnlyRef2 = new ObjectId()
     this.readOnlyRef2 = new ObjectId()

+ 1 - 1
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 () {
     it('should not remove the subscription when expired if it has Group SSO enabled', async function () {
       this.Features.hasFeature.withArgs('saas').returns(true)
       this.Features.hasFeature.withArgs('saas').returns(true)
-      this.subscription.ssoConfig = new ObjectId('abc123abc123')
+      this.subscription.ssoConfig = new ObjectId('abc123abc123abc123abc123')
 
 
       this.recurlySubscription.state = 'expired'
       this.recurlySubscription.state = 'expired'
       await this.SubscriptionUpdater.promises.updateSubscriptionFromRecurly(
       await this.SubscriptionUpdater.promises.updateSubscriptionFromRecurly(

+ 2 - 2
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) {
     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
       this.SSOConfig.findById
         .withArgs(this.subscription.ssoConfig)
         .withArgs(this.subscription.ssoConfig)
         .resolves({ enabled: true })
         .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) {
     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
       this.SSOConfig.findById
         .withArgs(this.subscription.ssoConfig)
         .withArgs(this.subscription.ssoConfig)
         .resolves({ enabled: false })
         .resolves({ enabled: false })