From 3e5273144e10f92204dfb872c6b30f88d11a6423 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 21 Nov 2023 11:03:14 +0000 Subject: [PATCH] Merge pull request #15656 from overleaf/bg-group-sso-login-acceptance-tests add acceptance tests for group sso login GitOrigin-RevId: 046d142ab478e45619b3a76d88eac73a808dfa08 --- services/web/app/src/Features/Errors/Errors.js | 3 +++ services/web/test/acceptance/src/helpers/Subscription.js | 2 ++ services/web/test/acceptance/src/helpers/User.js | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/services/web/app/src/Features/Errors/Errors.js b/services/web/app/src/Features/Errors/Errors.js index 731fe456ea..36cb7d5ab6 100644 --- a/services/web/app/src/Features/Errors/Errors.js +++ b/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, diff --git a/services/web/test/acceptance/src/helpers/Subscription.js b/services/web/test/acceptance/src/helpers/Subscription.js index 03badd4421..38ff8fa599 100644 --- a/services/web/test/acceptance/src/helpers/Subscription.js +++ b/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) { diff --git a/services/web/test/acceptance/src/helpers/User.js b/services/web/test/acceptance/src/helpers/User.js index 8811bac6ac..92cb834d07 100644 --- a/services/web/test/acceptance/src/helpers/User.js +++ b/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) {