Files
speckle-server/packages/server/modules/gatekeeper/tests/integration/prices.spec.ts
T
Kristaps Fabians Geikins 211922b6a6 chore: get rid of all old workspace plan code (#4624)
* first batch of changes

* tests fix

* FE fixed

* renaming constants

* test fixes

* moar test fixes

* another test fix

* reenable app rover check

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2025-04-30 19:18:32 +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 { PaidWorkspacePlans } 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(PaidWorkspacePlans)]
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)
}
})
}
)