From 570eaa8e5347a41de09b78fb283b50c3d585def1 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Tue, 24 Oct 2023 17:22:49 +0100 Subject: [PATCH] Update package.json + remove license.manage.spec.ts Update package.json - Updating "test:self:ci" - Now includes license. Needed to prevent license tests from running where an account portal is not setup Removing license.manage.spec.ts - This will be included in another PR - Work required to finish this test - Removing so the license activation test can be merged --- qa-core/package.json | 2 +- .../tests/licensing/license.manage.spec.ts | 57 ------------------- 2 files changed, 1 insertion(+), 58 deletions(-) delete mode 100644 qa-core/src/account-api/tests/licensing/license.manage.spec.ts diff --git a/qa-core/package.json b/qa-core/package.json index 3c789d89e6..d266ca9def 100644 --- a/qa-core/package.json +++ b/qa-core/package.json @@ -17,7 +17,7 @@ "test:notify": "node scripts/testResultsWebhook", "test:cloud:prod": "yarn run test --testPathIgnorePatterns=\\.integration\\.", "test:cloud:qa": "yarn run test", - "test:self:ci": "yarn run test --testPathIgnorePatterns=\\.integration\\. \\.cloud\\.", + "test:self:ci": "yarn run test --testPathIgnorePatterns=\\.integration\\. \\.cloud\\. \\.license\\.", "serve:test:self:ci": "start-server-and-test dev:built http://localhost:4001/health test:self:ci", "serve": "start-server-and-test dev:built http://localhost:4001/health", "dev:built": "cd ../ && yarn dev:built" diff --git a/qa-core/src/account-api/tests/licensing/license.manage.spec.ts b/qa-core/src/account-api/tests/licensing/license.manage.spec.ts deleted file mode 100644 index 3f87838ee4..0000000000 --- a/qa-core/src/account-api/tests/licensing/license.manage.spec.ts +++ /dev/null @@ -1,57 +0,0 @@ -import TestConfiguration from "../../config/TestConfiguration" -import * as fixtures from "../../fixtures" -import { Hosting, PlanType } from "@budibase/types" - -describe("license management", () => { - const config = new TestConfiguration() - - beforeAll(async () => { - await config.beforeAll() - }) - - afterAll(async () => { - await config.afterAll() - }) - - it("retrieves plans, creates checkout session, and updates license", async () => { - // Create cloud account - const createAccountRequest = fixtures.accounts.generateAccount({ - hosting: Hosting.CLOUD, - }) - - // Self response has free license - const [selfRes, selfBody] = await config.api.accounts.self() - expect(selfBody.license.plan.type).toBe(PlanType.FREE) - - // Retrieve plans - const [plansRes, planBody] = await config.api.licenses.getPlans() - - // Select priceId from premium plan - let premiumPriceId = null - for (const plan of planBody) { - if (plan.type === PlanType.PREMIUM) { - premiumPriceId = plan.prices[0].priceId - break - } - } - - // Create checkout session for price - const checkoutSessionRes = await config.api.stripe.createCheckoutSession( - premiumPriceId - ) - const checkoutSessionUrl = checkoutSessionRes[1].url - expect(checkoutSessionUrl).toContain("checkout.stripe.com") - - // TODO: Mimic checkout success - // Create stripe customer - // Create subscription for premium plan - // Assert license updated from free to premium - - // Create portal session - //await config.api.stripe.createPortalSession() - - // Update from free to business license - - // License updated - }) -})