Просмотр исходного кода

Merge pull request #15656 from overleaf/bg-group-sso-login-acceptance-tests

add acceptance tests for group sso login

GitOrigin-RevId: 046d142ab478e45619b3a76d88eac73a808dfa08
Brian Gough 2 лет назад
Родитель
Сommit
3e5273144e

+ 3 - 0
services/web/app/src/Features/Errors/Errors.js

@@ -120,6 +120,8 @@ class SAMLInvalidSignatureError extends SAMLAuthenticationError {
   }
 }
 
+class SAMLInvalidResponseError extends SAMLAuthenticationError {}
+
 class SAMLLoginFailureError extends SAMLAuthenticationError {
   get i18nKey() {
     return 'saml_login_failure'
@@ -259,6 +261,7 @@ module.exports = {
   SAMLGroupSSOLoginIdentityNotFoundError,
   SAMLGroupSSODisabledError,
   SAMLInvalidSignatureError,
+  SAMLInvalidResponseError,
   SAMLLoginFailureError,
   SLInV2Error,
   ThirdPartyIdentityExistsError,

+ 2 - 0
services/web/test/acceptance/src/helpers/Subscription.js

@@ -24,6 +24,8 @@ class Subscription {
     this.planCode = options.planCode
     this.recurlySubscription_id = options.recurlySubscription_id
     this.features = options.features
+    this.ssoConfig = options.ssoConfig
+    this.groupPolicy = options.groupPolicy
   }
 
   ensureExists(callback) {

+ 9 - 0
services/web/test/acceptance/src/helpers/User.js

@@ -40,6 +40,7 @@ class User {
     this._id = user._id.toString()
     this.first_name = user.first_name
     this.referal_id = user.referal_id
+    this.enrollment = user.enrollment
   }
 
   get(callback) {
@@ -228,6 +229,14 @@ class User {
     UserModel.updateOne({ _id: this.id }, { emails }, callback)
   }
 
+  setEnrollment(enrollment, callback) {
+    UserModel.updateOne({ _id: this.id }, { enrollment }, callback)
+  }
+
+  setSamlIdentifiers(samlIdentifiers, callback) {
+    UserModel.updateOne({ _id: this.id }, { samlIdentifiers }, callback)
+  }
+
   logout(callback) {
     this.getCsrfToken(error => {
       if (error != null) {