Files
overleaf-cep/services/web/test/acceptance/config/settings.test.saas.js
T
Rebeka DekanyandM Fahru 1f28eaecdb [web] Add Stripe acceptance tests (#34577)
* Add StripeClient mock-target support and Stripe test settings

Co-Authored-By: M Fahru <m.fahru@overleaf.com>

* Add Stripe payment page acceptance tests

Co-Authored-By: M Fahru <m.fahru@overleaf.com>

* Add MockStripeApi for stateful Stripe acceptance tests

Co-Authored-By: M Fahru <m.fahru@overleaf.com>

* Add Stripe subscription acceptance tests

* Add Stripe webhook acceptance tests

* Use a helper for setting the subscription status

---------

Co-authored-by: M Fahru <m.fahru@overleaf.com>
GitOrigin-RevId: b9bc50c914369da646ddb42ade1a02fd7baeb96b
2026-06-16 08:06:57 +00:00

111 lines
2.5 KiB
JavaScript

const { merge } = require('@overleaf/settings/merge')
const baseApp = require('../../../config/settings.overrides.saas')
const baseTest = require('./settings.test.defaults')
const httpAuthUser = 'overleaf'
const httpAuthPass = 'password'
const httpAuthUsers = {}
httpAuthUsers[httpAuthUser] = httpAuthPass
const overleafHost =
process.env.V2_URL ||
`http://${process.env.HTTP_TEST_HOST || '127.0.0.1'}:23000`
const overrides = {
appName: 'Overleaf',
siteUrl: overleafHost,
enableSubscriptions: true,
apis: {
thirdPartyDataStore: {
url: `http://127.0.0.1:23002`,
dropboxApp: 'Overleaf',
},
analytics: {
url: `http://127.0.0.1:23050`,
},
recurly: {
url: 'http://127.0.0.1:26034',
subdomain: 'test',
apiKey: 'private-nonsense',
webhookUser: 'recurly',
webhookPass: 'webhook',
},
stripeUS: {
accountId: 'test_us_account',
publishableKey: 'test_us_publishable_key',
secretKey: 'sk_test_xxx',
webhookSignature: 'test_us_webhook_signature',
},
stripeUK: {
accountId: 'test_uk_account',
publishableKey: 'test_uk_publishable_key',
secretKey: 'sk_test_xxx',
webhookSignature: 'test_uk_webhook_signature',
},
v1: {
url: `http://127.0.0.1:25000`,
user: 'overleaf',
pass: 'password',
},
tags: {
url: 'http://127.0.0.1:25000',
},
},
oauthProviders: {
provider: {
name: 'provider',
},
collabratec: {
name: 'collabratec',
},
google: {
name: 'google',
},
},
saml: undefined,
contentful: {
spaceId: 'a',
deliveryToken: 'b',
previewToken: 'c',
deliveryApiHost: 'cdn.contentful.com',
previewApiHost: 'preview.contentful.com',
},
twoFactorAuthentication: {
accessTokenEncryptorOptions: {
cipherPasswords: {
'2023.1-v3': 'this-is-a-weak-secret-for-tests-web-2023.1-v3',
},
},
},
overleaf: {
host: 'http://127.0.0.1:25000',
oauth: {
clientID: 'mock-oauth-client-id',
clientSecret: 'mock-oauth-client-secret',
},
},
analytics: {
enabled: true,
hashedEmailSalt: 'acceptance-test-salt',
},
}
module.exports = baseApp.mergeWith(baseTest.mergeWith(overrides))
for (const redisKey of Object.keys(module.exports.redis)) {
module.exports.redis[redisKey].host = process.env.REDIS_HOST || '127.0.0.1'
}
module.exports.mergeWith = function (overrides) {
return merge(overrides, module.exports)
}