Files
speckle-server/packages/server/modules/gatekeeper/tests/integration/prices.spec.ts
T
Gergő Jedlicska 61ca128ce2 gergo/multiCurrency (#4379)
* feat(gatekeeper): support multiple currencies

* feat(helm): add new currency based prices to helm chart

* chore(env): add example currency based pricing values

* fix(ci): update price ids to the proper values

* feat(helm): rename price ids to fit multi currency

* feat(gatekeeper): currency input for checkout session

* Updated prices in the FE

* chore(gatekeeper): remove old checkout session flow

* Updated prices in the FE

* Fix FE

* Fix pipeline

---------

Co-authored-by: Mike Tasset <mike.tasset@gmail.com>
2025-04-11 17:37:47 +02:00

39 lines
1.3 KiB
TypeScript

import { getFeatureFlags } from '@/modules/shared/helpers/envHelper'
import { GetWorkspacePlanPricesDocument } from '@/test/graphql/generated/graphql'
import { TestApolloServer, testApolloServer } from '@/test/graphqlHelper'
import { PaidWorkspacePlansNew } from '@speckle/shared'
import { expect } from 'chai'
import { Currency } from '@/modules/gatekeeper/domain/billing'
const { FF_BILLING_INTEGRATION_ENABLED } = getFeatureFlags()
;(FF_BILLING_INTEGRATION_ENABLED ? describe : describe.skip)(
'Workspace plan prices',
() => {
let apollo: TestApolloServer
before(async () => {
apollo = await testApolloServer()
})
const getPrices = () => apollo.execute(GetWorkspacePlanPricesDocument, {})
it('returns prices', async () => {
const res = await getPrices()
const expectedPlans = [...Object.values(PaidWorkspacePlansNew)]
expect(res).to.not.haveGraphQLErrors()
const prices = res.data?.serverInfo.workspaces.planPrices
expect(prices).to.not.be.null
if (!prices) throw new Error('This cannot be')
for (const currency of Object.values(Currency)) {
const p = prices[currency]
expect(Object.keys(p)).to.have.lengthOf(expectedPlans.length)
expect(Object.keys(p)).to.deep.equalInAnyOrder(expectedPlans)
}
})
}
)