diff --git a/.circleci/config.yml b/.circleci/config.yml index 6b78f11d7d..9d849587f8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,6 +44,9 @@ workflows: - test-objectsender: filters: *filters-allow-all + - test-shared: + filters: *filters-allow-all + - test-preview-service: filters: *filters-allow-all @@ -184,6 +187,7 @@ workflows: - test-frontend-2 - test-viewer - test-objectsender + - test-shared - test-server - test-server-no-ff - test-server-multiregion @@ -200,6 +204,7 @@ workflows: - test-frontend-2 - test-viewer - test-objectsender + - test-shared - test-server - test-server-no-ff - test-server-multiregion @@ -216,6 +221,7 @@ workflows: - test-frontend-2 - test-viewer - test-objectsender + - test-shared - test-server - test-server-no-ff - test-server-multiregion @@ -232,6 +238,7 @@ workflows: - test-frontend-2 - test-viewer - test-objectsender + - test-shared - test-server - test-server-no-ff - test-server-multiregion @@ -248,6 +255,7 @@ workflows: - test-frontend-2 - test-viewer - test-objectsender + - test-shared - test-server - test-server-no-ff - test-server-multiregion @@ -264,6 +272,7 @@ workflows: - test-frontend-2 - test-viewer - test-objectsender + - test-shared - test-server - test-server-no-ff - test-server-multiregion @@ -286,6 +295,7 @@ workflows: - test-frontend-2 - test-viewer - test-objectsender + - test-shared - test-server - test-server-no-ff - test-server-multiregion @@ -302,6 +312,7 @@ workflows: - test-frontend-2 - test-viewer - test-objectsender + - test-shared - test-server - test-server-no-ff - test-server-multiregion @@ -349,6 +360,7 @@ workflows: - test-frontend-2 - test-viewer - test-objectsender + - test-shared - test-preview-service - publish-viewer-sandbox-cloudflare-pages: @@ -729,6 +741,36 @@ jobs: command: yarn test working_directory: 'packages/preview-service' + test-shared: + docker: *docker-node-browsers-image + resource_class: medium+ + steps: + - checkout + - restore_cache: + name: Restore Yarn Package Cache + keys: + - yarn-packages-server-{{ checksum "yarn.lock" }} + - run: + name: Install Dependencies + command: yarn + + - save_cache: + name: Save Yarn Package Cache + key: yarn-packages-server-{{ checksum "yarn.lock" }} + paths: + - .yarn/cache + - .yarn/unplugged + + - run: + name: Lint + command: yarn lint:ci + working_directory: 'packages/shared' + + - run: + name: Run tests + command: yarn test:single-run + working_directory: 'packages/shared' + test-objectsender: docker: *docker-node-browsers-image resource_class: large diff --git a/package.json b/package.json index 5964d2d2c1..ccce840dcd 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "prettier": "^2.5.1", "ts-node": "^10.9.1", "tsconfig-paths": "^4.0.0", + "vitest": "^3.0.7", "zx": "^8.1.2" }, "resolutions": { @@ -91,7 +92,8 @@ "typescript": "^5.7.3", "typescript-eslint": "^8.20.0", "wait-on": ">=7.2.0", - "vue-tsc@npm:2.2.2/@vue/language-core": "2.2.0" + "vue-tsc@npm:2.2.2/@vue/language-core": "2.2.0", + "vitest": "^3.0.7" }, "config": { "commitizen": { diff --git a/packages/frontend-2/codegen.ts b/packages/frontend-2/codegen.ts index 04279dfe82..afbde2729f 100644 --- a/packages/frontend-2/codegen.ts +++ b/packages/frontend-2/codegen.ts @@ -23,6 +23,7 @@ const config: CodegenConfig = { './lib/common/generated/gql/': { preset: 'client', config: { + enumsAsConst: true, useTypeImports: true, fragmentMasking: false, dedupeFragments: true, diff --git a/packages/frontend-2/components/automate/runs/trigger-status/dialog/FunctionRun.vue b/packages/frontend-2/components/automate/runs/trigger-status/dialog/FunctionRun.vue index c344250d62..4a951242be 100644 --- a/packages/frontend-2/components/automate/runs/trigger-status/dialog/FunctionRun.vue +++ b/packages/frontend-2/components/automate/runs/trigger-status/dialog/FunctionRun.vue @@ -22,13 +22,7 @@
Function is {{ functionRun.status.toLowerCase() }}. @@ -141,4 +135,14 @@ const results = useAutomationFunctionRunResults({ const showAttachmentDialog = ref(false) const attachments = computed(() => results.value?.values.blobIds || []) + +const isStartingOrRunning = computed(() => + ( + [ + AutomateRunStatus.Initializing, + AutomateRunStatus.Running, + AutomateRunStatus.Pending + ] as string[] + ).includes(props.functionRun.status) +) diff --git a/packages/frontend-2/components/automate/viewer/panel/FunctionRunRow.vue b/packages/frontend-2/components/automate/viewer/panel/FunctionRunRow.vue index ace26f50fa..774e02c233 100644 --- a/packages/frontend-2/components/automate/viewer/panel/FunctionRunRow.vue +++ b/packages/frontend-2/components/automate/viewer/panel/FunctionRunRow.vue @@ -156,11 +156,13 @@ const hasValidContextView = computed(() => { }) const statusMessage = computed(() => { - const isFinished = ![ - AutomateRunStatus.Initializing, - AutomateRunStatus.Running, - AutomateRunStatus.Pending - ].includes(props.functionRun.status) + const isFinished = !( + [ + AutomateRunStatus.Initializing, + AutomateRunStatus.Running, + AutomateRunStatus.Pending + ] as string[] + ).includes(props.functionRun.status) return isFinished ? props.functionRun.statusMessage ?? 'No status message' diff --git a/packages/frontend-2/components/settings/workspaces/billing/PricingTable/Plan.vue b/packages/frontend-2/components/settings/workspaces/billing/PricingTable/Plan.vue index 933906ae0f..3b283b453c 100644 --- a/packages/frontend-2/components/settings/workspaces/billing/PricingTable/Plan.vue +++ b/packages/frontend-2/components/settings/workspaces/billing/PricingTable/Plan.vue @@ -5,7 +5,7 @@

Workspace - {{ plan.name }} + {{ plan }}

{{ badgeText }} @@ -15,8 +15,8 @@ £{{ yearlyIntervalSelected - ? plan.cost.yearly[Roles.Workspace.Member] - : plan.cost.monthly[Roles.Workspace.Member] + ? planPrices.yearly[Roles.Workspace.Member] + : planPrices.monthly[Roles.Workspace.Member] }} per seat/month @@ -40,7 +40,7 @@
  • - {{ feature.name }} + {{ featureMetadata.displayName }}
@@ -89,7 +92,7 @@