feat(workspaces): add discount and total fields
This commit is contained in:
@@ -47,6 +47,7 @@ import {
|
||||
import { getBranchesByStreamId } from '@/modules/core/services/branches'
|
||||
import { grantStreamPermissions } from '@/modules/core/repositories/streams'
|
||||
import { getWorkspaceFactory } from '@/modules/workspaces/repositories/workspaces'
|
||||
import { WorkspaceEarlyAdopterDiscount } from '@/modules/workspaces/domain/constants'
|
||||
|
||||
const createProjectWithVersions =
|
||||
({ apollo }: { apollo: TestApolloServer }) =>
|
||||
@@ -310,7 +311,8 @@ describe('Workspaces GQL CRUD', () => {
|
||||
})
|
||||
|
||||
expect(res).to.not.haveGraphQLErrors()
|
||||
const { subTotal, currency, items } = res.data!.workspace.billing.cost
|
||||
const { subTotal, currency, items, total, discount } =
|
||||
res.data!.workspace.billing.cost
|
||||
expect(subTotal).to.equal(70 + 50 + 10)
|
||||
expect(currency).to.equal('GBP')
|
||||
expect(items).to.deep.equal([
|
||||
@@ -335,6 +337,8 @@ describe('Workspaces GQL CRUD', () => {
|
||||
cost: 0
|
||||
}
|
||||
])
|
||||
expect(discount).to.deep.equal(WorkspaceEarlyAdopterDiscount)
|
||||
expect(total).to.equal(65)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user