@taskforcehq/taskforce 0.3.309 → 0.3.313
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -127
- package/dist/TaskforceCore.js +1 -1
- package/dist/components/context/ContextAttachmentManager.js +4 -3
- package/dist/components/features/InitiativesModule.js +1 -1
- package/dist/components/features/TaskSettings.js +1 -1
- package/dist/components/ui/DisclosureSectionHeader.d.ts +12 -0
- package/dist/components/ui/DisclosureSectionHeader.js +8 -0
- package/dist/components/views/PlanComparisonPage.js +1 -1
- package/dist/components/views/StandaloneLayout.js +18 -4
- package/dist/components/views/panels/PlanningDrawer.js +2 -1
- package/dist/components/views/standalone/modals/AccountHubModal.js +1 -1
- package/dist/components/views/standalone/modals/HelpModal.d.ts +3 -1
- package/dist/components/views/standalone/modals/HelpModal.js +17 -2
- package/dist/core/PlanEntitlementService.d.ts +2 -0
- package/dist/core/PlanEntitlementService.js +57 -4
- package/dist/hooks/useFilterSort.js +1 -1
- package/dist/hooks/useTaskforce.js +2 -2
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.js +5 -2
- package/dist/localization/locales/en-US.js +1 -1
- package/dist/localization/locales/es-419.js +1 -1
- package/dist/localization/locales/pt-BR.js +1 -1
- package/dist/mcp/runtime.js +49 -14
- package/dist/server/routes/billing.js +0 -1
- package/dist/ui/assets/AgentsModule-BULqIo8e.js +1 -0
- package/dist/ui/assets/{AnnotatedAttachmentWorkspace-CCckzWYZ.js → AnnotatedAttachmentWorkspace-DHr4rHK9.js} +1 -1
- package/dist/ui/assets/ContextAttachmentManager-DoMe2OpY.js +3 -0
- package/dist/ui/assets/{DocumentWorkspace-BVaWPA25.js → DocumentWorkspace-DumBWhvb.js} +1 -1
- package/dist/ui/assets/{EntityActivityTimeline-DSj0ThaK.js → EntityActivityTimeline-sHk8Nzbq.js} +1 -1
- package/dist/ui/assets/{InitiativesModule-AxMkWtxH.js → InitiativesModule-3X9UNzHh.js} +1 -1
- package/dist/ui/assets/PlansPage-C3A3EYaV.js +1 -0
- package/dist/ui/assets/PlansPage-DeAzWYTb.css +1 -0
- package/dist/ui/assets/{TaskContextUpload-Dw4rTF4i.js → TaskContextUpload-C8G7pWkX.js} +1 -1
- package/dist/ui/assets/{TaskSettings-f2ga42_V.js → TaskSettings-DM1o9Wla.js} +2 -2
- package/dist/ui/assets/{WorkflowsModule-E4UL3mov.js → WorkflowsModule-CW0crzvD.js} +1 -1
- package/dist/ui/assets/documentReferences-BZB3nMRb.js +1 -0
- package/dist/ui/assets/index-BWFQ9mGn.js +5 -0
- package/dist/ui/assets/{index-BvAbqx5Q.css → index-DcK_8tuE.css} +1 -1
- package/dist/ui/assets/{vendor-icons-B32hGuF2.js → vendor-icons-CLnehDTw.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/utils/supportContact.d.ts +9 -0
- package/dist/utils/supportContact.js +32 -0
- package/package.json +12 -4
- package/scripts/postinstall.js +4 -3
- package/dist/TaskforceCore.CategoryFallback.test.d.ts +0 -1
- package/dist/TaskforceCore.CategoryFallback.test.js +0 -101
- package/dist/TaskforceCore.filter-persistence.test.d.ts +0 -1
- package/dist/TaskforceCore.filter-persistence.test.js +0 -402
- package/dist/TaskforceCore.routing.test.d.ts +0 -1
- package/dist/TaskforceCore.routing.test.js +0 -311
- package/dist/TaskforceCore.test.d.ts +0 -1
- package/dist/TaskforceCore.test.js +0 -7910
- package/dist/TaskforceWidget.test.d.ts +0 -1
- package/dist/TaskforceWidget.test.js +0 -92
- package/dist/UnsavedChangesRelaxed.test.d.ts +0 -1
- package/dist/UnsavedChangesRelaxed.test.js +0 -16
- package/dist/__tests__/localizationCatalogs.test.d.ts +0 -1
- package/dist/__tests__/localizationCatalogs.test.js +0 -54
- package/dist/__tests__/workflowSimulation.test.d.ts +0 -1
- package/dist/__tests__/workflowSimulation.test.js +0 -113
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.test.d.ts +0 -1
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.test.js +0 -278
- package/dist/annotatedAttachments/payload.test.d.ts +0 -1
- package/dist/annotatedAttachments/payload.test.js +0 -67
- package/dist/compat/workspaceSyncCompat.test.d.ts +0 -1
- package/dist/compat/workspaceSyncCompat.test.js +0 -124
- package/dist/components/features/AgentsModule.test.d.ts +0 -1
- package/dist/components/features/AgentsModule.test.js +0 -601
- package/dist/components/features/AnnotatedAttachmentWorkspace.test.d.ts +0 -1
- package/dist/components/features/AnnotatedAttachmentWorkspace.test.js +0 -2883
- package/dist/components/features/DocumentWorkspace.test.d.ts +0 -1
- package/dist/components/features/DocumentWorkspace.test.js +0 -1439
- package/dist/components/features/TaskSettings.test.d.ts +0 -1
- package/dist/components/features/TaskSettings.test.js +0 -1674
- package/dist/components/features/settings/TaxonomyLibraryManager.test.d.ts +0 -1
- package/dist/components/features/settings/TaxonomyLibraryManager.test.js +0 -141
- package/dist/components/task/TaskActionHeader.test.d.ts +0 -1
- package/dist/components/task/TaskActionHeader.test.js +0 -91
- package/dist/components/task/TaskCard.test.d.ts +0 -1
- package/dist/components/task/TaskCard.test.js +0 -513
- package/dist/components/task/TaskContextUpload.test.d.ts +0 -1
- package/dist/components/task/TaskContextUpload.test.js +0 -506
- package/dist/components/task/TaskForm.test.d.ts +0 -1
- package/dist/components/task/TaskForm.test.js +0 -946
- package/dist/components/task/TaskKanban.empty-column-drop.test.d.ts +0 -1
- package/dist/components/task/TaskKanban.empty-column-drop.test.js +0 -66
- package/dist/components/task/TaskKanban.planning-drop.test.d.ts +0 -1
- package/dist/components/task/TaskKanban.planning-drop.test.js +0 -93
- package/dist/components/task/TaskKanban.test.d.ts +0 -1
- package/dist/components/task/TaskKanban.test.js +0 -99
- package/dist/components/task/TaskList.test.d.ts +0 -1
- package/dist/components/task/TaskList.test.js +0 -473
- package/dist/components/task/TaskStatusActions.test.d.ts +0 -1
- package/dist/components/task/TaskStatusActions.test.js +0 -54
- package/dist/components/task/taskKanbanDropRules.test.d.ts +0 -1
- package/dist/components/task/taskKanbanDropRules.test.js +0 -114
- package/dist/components/ui/LevelSelector.test.d.ts +0 -1
- package/dist/components/ui/LevelSelector.test.js +0 -55
- package/dist/components/ui/Markdown.test.d.ts +0 -1
- package/dist/components/ui/Markdown.test.js +0 -38
- package/dist/components/ui/MultiSelectFilter.test.d.ts +0 -1
- package/dist/components/ui/MultiSelectFilter.test.js +0 -74
- package/dist/components/ui/TaxonomyDropdown.test.d.ts +0 -1
- package/dist/components/ui/TaxonomyDropdown.test.js +0 -130
- package/dist/components/ui/TopNoticeLayer.test.d.ts +0 -1
- package/dist/components/ui/TopNoticeLayer.test.js +0 -25
- package/dist/components/views/AppShellHeader.test.d.ts +0 -1
- package/dist/components/views/AppShellHeader.test.js +0 -42
- package/dist/components/views/PlanComparisonPage.test.d.ts +0 -1
- package/dist/components/views/PlanComparisonPage.test.js +0 -757
- package/dist/components/views/PlansPage.test.d.ts +0 -1
- package/dist/components/views/PlansPage.test.js +0 -710
- package/dist/components/views/chrome/WorkspaceChromeSections.test.d.ts +0 -1
- package/dist/components/views/chrome/WorkspaceChromeSections.test.js +0 -54
- package/dist/components/views/chrome/workspaceChrome.test.d.ts +0 -1
- package/dist/components/views/chrome/workspaceChrome.test.js +0 -52
- package/dist/components/views/panels/DocumentFilterToolbar.test.d.ts +0 -1
- package/dist/components/views/panels/DocumentFilterToolbar.test.js +0 -19
- package/dist/components/views/panels/FilterToolbar.test.d.ts +0 -1
- package/dist/components/views/panels/FilterToolbar.test.js +0 -47
- package/dist/components/views/panels/PlanningDrawer.test.d.ts +0 -1
- package/dist/components/views/panels/PlanningDrawer.test.js +0 -529
- package/dist/components/views/planningScope.test.d.ts +0 -1
- package/dist/components/views/planningScope.test.js +0 -60
- package/dist/components/views/standalone/modals/AccountHubModal.test.d.ts +0 -1
- package/dist/components/views/standalone/modals/AccountHubModal.test.js +0 -66
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.d.ts +0 -1
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.js +0 -24
- package/dist/components/views/teamManagementAccess.test.d.ts +0 -1
- package/dist/components/views/teamManagementAccess.test.js +0 -44
- package/dist/config/deployment.test.d.ts +0 -1
- package/dist/config/deployment.test.js +0 -90
- package/dist/config/envSchema.test.d.ts +0 -1
- package/dist/config/envSchema.test.js +0 -125
- package/dist/core/AiProfileService.test.d.ts +0 -1
- package/dist/core/AiProfileService.test.js +0 -184
- package/dist/core/AiProfiles.test.d.ts +0 -1
- package/dist/core/AiProfiles.test.js +0 -1873
- package/dist/core/AuthTokenService.test.d.ts +0 -1
- package/dist/core/AuthTokenService.test.js +0 -78
- package/dist/core/BulkUpdateFieldsPreview.test.d.ts +0 -1
- package/dist/core/BulkUpdateFieldsPreview.test.js +0 -62
- package/dist/core/CompletedAt.test.d.ts +0 -1
- package/dist/core/CompletedAt.test.js +0 -44
- package/dist/core/CreatedBy.test.d.ts +0 -1
- package/dist/core/CreatedBy.test.js +0 -188
- package/dist/core/DeletedTaskTrash.test.d.ts +0 -1
- package/dist/core/DeletedTaskTrash.test.js +0 -104
- package/dist/core/EntitlementsPolicy.test.d.ts +0 -1
- package/dist/core/EntitlementsPolicy.test.js +0 -280
- package/dist/core/GlobalSettingsService.test.d.ts +0 -1
- package/dist/core/GlobalSettingsService.test.js +0 -45
- package/dist/core/JsonBackupRuntime.test.d.ts +0 -1
- package/dist/core/JsonBackupRuntime.test.js +0 -155
- package/dist/core/PlanFeatureCatalog.test.d.ts +0 -1
- package/dist/core/PlanFeatureCatalog.test.js +0 -139
- package/dist/core/PlanVersionPolicy.test.d.ts +0 -1
- package/dist/core/PlanVersionPolicy.test.js +0 -204
- package/dist/core/PlanningEntities.test.d.ts +0 -1
- package/dist/core/PlanningEntities.test.js +0 -509
- package/dist/core/ScheduleFields.test.d.ts +0 -1
- package/dist/core/ScheduleFields.test.js +0 -193
- package/dist/core/SetupState.test.d.ts +0 -1
- package/dist/core/SetupState.test.js +0 -113
- package/dist/core/SignupMonetizationSettings.test.d.ts +0 -1
- package/dist/core/SignupMonetizationSettings.test.js +0 -515
- package/dist/core/Stats.test.d.ts +0 -1
- package/dist/core/Stats.test.js +0 -36
- package/dist/core/SystemAdmin.test.d.ts +0 -1
- package/dist/core/SystemAdmin.test.js +0 -1106
- package/dist/core/TaskActivitySync.test.d.ts +0 -1
- package/dist/core/TaskActivitySync.test.js +0 -90
- package/dist/core/TaskAttachmentsCanonical.test.d.ts +0 -1
- package/dist/core/TaskAttachmentsCanonical.test.js +0 -356
- package/dist/core/TaskAuditTimeline.test.d.ts +0 -1
- package/dist/core/TaskAuditTimeline.test.js +0 -319
- package/dist/core/TaskTaxonomyValidation.test.d.ts +0 -1
- package/dist/core/TaskTaxonomyValidation.test.js +0 -440
- package/dist/core/Taskforce.ids.test.d.ts +0 -1
- package/dist/core/Taskforce.ids.test.js +0 -611
- package/dist/core/Taskforce.listTasksSlim.test.d.ts +0 -1
- package/dist/core/Taskforce.listTasksSlim.test.js +0 -91
- package/dist/core/Taskforce.mcpAuth.test.d.ts +0 -1
- package/dist/core/Taskforce.mcpAuth.test.js +0 -450
- package/dist/core/Taskforce.realtimeMutation.test.d.ts +0 -1
- package/dist/core/Taskforce.realtimeMutation.test.js +0 -131
- package/dist/core/UserProfileAvatarDrafts.test.d.ts +0 -1
- package/dist/core/UserProfileAvatarDrafts.test.js +0 -138
- package/dist/core/WorkspaceDelete.test.d.ts +0 -1
- package/dist/core/WorkspaceDelete.test.js +0 -159
- package/dist/core/WorkspacePermissions.test.d.ts +0 -1
- package/dist/core/WorkspacePermissions.test.js +0 -270
- package/dist/core/WorkspacePlanMode.test.d.ts +0 -1
- package/dist/core/WorkspacePlanMode.test.js +0 -383
- package/dist/core/WorkspaceSyncSettings.test.d.ts +0 -1
- package/dist/core/WorkspaceSyncSettings.test.js +0 -65
- package/dist/core/__tests__/TaskAttachmentsCanonical.test.d.ts +0 -1
- package/dist/core/__tests__/TaskAttachmentsCanonical.test.js +0 -212
- package/dist/documentReviews/DocumentReviewSessionStore.test.d.ts +0 -1
- package/dist/documentReviews/DocumentReviewSessionStore.test.js +0 -127
- package/dist/hooks/authGuardPolicy.test.d.ts +0 -1
- package/dist/hooks/authGuardPolicy.test.js +0 -76
- package/dist/hooks/bootstrapTimeouts.test.d.ts +0 -1
- package/dist/hooks/bootstrapTimeouts.test.js +0 -12
- package/dist/hooks/sync/controlPlane.test.d.ts +0 -1
- package/dist/hooks/sync/controlPlane.test.js +0 -121
- package/dist/hooks/sync/lifecyclePolicy.test.d.ts +0 -1
- package/dist/hooks/sync/lifecyclePolicy.test.js +0 -124
- package/dist/hooks/sync/orchestratorShared.test.d.ts +0 -1
- package/dist/hooks/sync/orchestratorShared.test.js +0 -98
- package/dist/hooks/sync/pullLifecycle.test.d.ts +0 -1
- package/dist/hooks/sync/pullLifecycle.test.js +0 -80
- package/dist/hooks/sync/recovery.test.d.ts +0 -1
- package/dist/hooks/sync/recovery.test.js +0 -292
- package/dist/hooks/sync/transfers.test.d.ts +0 -1
- package/dist/hooks/sync/transfers.test.js +0 -928
- package/dist/hooks/sync/useRecentSyncEvents.test.d.ts +0 -1
- package/dist/hooks/sync/useRecentSyncEvents.test.js +0 -124
- package/dist/hooks/sync/useSyncStatusActions.test.d.ts +0 -1
- package/dist/hooks/sync/useSyncStatusActions.test.js +0 -133
- package/dist/hooks/sync/useSyncStatusControls.test.d.ts +0 -1
- package/dist/hooks/sync/useSyncStatusControls.test.js +0 -88
- package/dist/hooks/useFilterSort.test.d.ts +0 -1
- package/dist/hooks/useFilterSort.test.js +0 -419
- package/dist/hooks/useRealtimeSync.test.d.ts +0 -1
- package/dist/hooks/useRealtimeSync.test.js +0 -311
- package/dist/hooks/useSyncOrchestrator.aiProfiles.test.d.ts +0 -1
- package/dist/hooks/useSyncOrchestrator.aiProfiles.test.js +0 -54
- package/dist/hooks/useSyncOrchestrator.context-assets.test.d.ts +0 -1
- package/dist/hooks/useSyncOrchestrator.context-assets.test.js +0 -228
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.d.ts +0 -1
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +0 -2027
- package/dist/hooks/useTaskData.test.d.ts +0 -1
- package/dist/hooks/useTaskData.test.js +0 -291
- package/dist/hooks/useTaskMutations.test.d.ts +0 -1
- package/dist/hooks/useTaskMutations.test.js +0 -256
- package/dist/hooks/useTaskforce.contract.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.contract.test.js +0 -7
- package/dist/hooks/useTaskforce.priority-filters.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.priority-filters.test.js +0 -28
- package/dist/hooks/useTaskforce.runtime-routing.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.runtime-routing.test.js +0 -246
- package/dist/hooks/useTaskforce.sync-behavior.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.sync-behavior.test.js +0 -3644
- package/dist/hooks/useWorkspaceSyncController.test.d.ts +0 -1
- package/dist/hooks/useWorkspaceSyncController.test.js +0 -192
- package/dist/hooks/workspace/useTaskforceApiRouting.test.d.ts +0 -1
- package/dist/hooks/workspace/useTaskforceApiRouting.test.js +0 -77
- package/dist/hooks/workspace/workspaceLocalState.test.d.ts +0 -1
- package/dist/hooks/workspace/workspaceLocalState.test.js +0 -59
- package/dist/localization/localizationCatalogs.test.d.ts +0 -1
- package/dist/localization/localizationCatalogs.test.js +0 -37
- package/dist/mcp/aiProfileBootstrap.test.d.ts +0 -1
- package/dist/mcp/aiProfileBootstrap.test.js +0 -68
- package/dist/mcp/canonicalAssetHelpers.test.d.ts +0 -1
- package/dist/mcp/canonicalAssetHelpers.test.js +0 -67
- package/dist/mcp/clientIntegrations.test.d.ts +0 -1
- package/dist/mcp/clientIntegrations.test.js +0 -219
- package/dist/mcp/optionResolution.test.d.ts +0 -1
- package/dist/mcp/optionResolution.test.js +0 -43
- package/dist/mcp/runtime.test.d.ts +0 -1
- package/dist/mcp/runtime.test.js +0 -5120
- package/dist/mcp/structuredCommentValidation.test.d.ts +0 -1
- package/dist/mcp/structuredCommentValidation.test.js +0 -31
- package/dist/mcp/structuredDocValidation.test.d.ts +0 -1
- package/dist/mcp/structuredDocValidation.test.js +0 -35
- package/dist/mcp/toolRegistry.test.d.ts +0 -1
- package/dist/mcp/toolRegistry.test.js +0 -34
- package/dist/migrations/billingSchemaParity.test.d.ts +0 -1
- package/dist/migrations/billingSchemaParity.test.js +0 -160
- package/dist/migrations/taskSchemaMigrations.test.d.ts +0 -1
- package/dist/migrations/taskSchemaMigrations.test.js +0 -225
- package/dist/qaOpen.test.d.ts +0 -1
- package/dist/qaOpen.test.js +0 -56
- package/dist/releaseVersion.test.d.ts +0 -1
- package/dist/releaseVersion.test.js +0 -32
- package/dist/runtime/appGates.test.d.ts +0 -1
- package/dist/runtime/appGates.test.js +0 -42
- package/dist/server/aiProfileAvatarAssets.test.d.ts +0 -1
- package/dist/server/aiProfileAvatarAssets.test.js +0 -213
- package/dist/server/annotatedAttachmentsRoutes.test.d.ts +0 -1
- package/dist/server/annotatedAttachmentsRoutes.test.js +0 -532
- package/dist/server/auth.test.d.ts +0 -1
- package/dist/server/auth.test.js +0 -131
- package/dist/server/buildInfo.test.d.ts +0 -1
- package/dist/server/buildInfo.test.js +0 -29
- package/dist/server/cors.test.d.ts +0 -1
- package/dist/server/cors.test.js +0 -77
- package/dist/server/documentReviewRoutes.test.d.ts +0 -1
- package/dist/server/documentReviewRoutes.test.js +0 -190
- package/dist/server/email.test.d.ts +0 -1
- package/dist/server/email.test.js +0 -113
- package/dist/server/index.cookieProxy.test.d.ts +0 -1
- package/dist/server/index.cookieProxy.test.js +0 -67
- package/dist/server/index.rateLimit.test.d.ts +0 -1
- package/dist/server/index.rateLimit.test.js +0 -22
- package/dist/server/index.test.d.ts +0 -1
- package/dist/server/index.test.js +0 -283
- package/dist/server/rateLimit.test.d.ts +0 -1
- package/dist/server/rateLimit.test.js +0 -107
- package/dist/server/realtimeSync.auth.test.d.ts +0 -1
- package/dist/server/realtimeSync.auth.test.js +0 -62
- package/dist/server/realtimeSync.replay.test.d.ts +0 -1
- package/dist/server/realtimeSync.replay.test.js +0 -192
- package/dist/server/realtimeSync.workspaceIsolation.test.d.ts +0 -1
- package/dist/server/realtimeSync.workspaceIsolation.test.js +0 -101
- package/dist/server/routes/billing.test.d.ts +0 -1
- package/dist/server/routes/billing.test.js +0 -3455
- package/dist/server/routes/shared.test.d.ts +0 -1
- package/dist/server/routes/shared.test.js +0 -32
- package/dist/server/routes/sync.integration.test.d.ts +0 -1
- package/dist/server/routes/sync.integration.test.js +0 -2932
- package/dist/server/routes/syncAuxRoutes.test.d.ts +0 -1
- package/dist/server/routes/syncAuxRoutes.test.js +0 -158
- package/dist/server/routes/syncRouteGuards.test.d.ts +0 -1
- package/dist/server/routes/syncRouteGuards.test.js +0 -94
- package/dist/server/routes.test.d.ts +0 -1
- package/dist/server/routes.test.js +0 -15612
- package/dist/server/runtimeMode.test.d.ts +0 -1
- package/dist/server/runtimeMode.test.js +0 -26
- package/dist/server/securityHeaders.test.d.ts +0 -1
- package/dist/server/securityHeaders.test.js +0 -70
- package/dist/services/templateEngine.test.d.ts +0 -1
- package/dist/services/templateEngine.test.js +0 -150
- package/dist/services/templates.test.d.ts +0 -1
- package/dist/services/templates.test.js +0 -45
- package/dist/services/workflowDocumentFixtures.test.d.ts +0 -1
- package/dist/services/workflowDocumentFixtures.test.js +0 -78
- package/dist/services/workflowExportMatrix.test.d.ts +0 -1
- package/dist/services/workflowExportMatrix.test.js +0 -113
- package/dist/services/workflowExportSnapshots.test.d.ts +0 -1
- package/dist/services/workflowExportSnapshots.test.js +0 -30
- package/dist/services/workflowGeneration.test.d.ts +0 -1
- package/dist/services/workflowGeneration.test.js +0 -12
- package/dist/services/workflowSimulation.test.d.ts +0 -1
- package/dist/services/workflowSimulation.test.js +0 -113
- package/dist/services/workflowV2Policy.test.d.ts +0 -1
- package/dist/services/workflowV2Policy.test.js +0 -80
- package/dist/shared/customTaxonomyLibrary.test.d.ts +0 -1
- package/dist/shared/customTaxonomyLibrary.test.js +0 -20
- package/dist/shared/passwordPolicy.test.d.ts +0 -1
- package/dist/shared/passwordPolicy.test.js +0 -34
- package/dist/shared/runtimeContract.test.d.ts +0 -1
- package/dist/shared/runtimeContract.test.js +0 -23
- package/dist/shared/taxonomyLibrary.test.d.ts +0 -1
- package/dist/shared/taxonomyLibrary.test.js +0 -26
- package/dist/shared/taxonomyState.test.d.ts +0 -1
- package/dist/shared/taxonomyState.test.js +0 -71
- package/dist/soak/preflight.cli.d.ts +0 -1
- package/dist/soak/preflight.cli.js +0 -28
- package/dist/soak/preflight.d.ts +0 -26
- package/dist/soak/preflight.js +0 -113
- package/dist/soak/preflight.test.d.ts +0 -1
- package/dist/soak/preflight.test.js +0 -39
- package/dist/storage/objectStorageClient.test.d.ts +0 -1
- package/dist/storage/objectStorageClient.test.js +0 -82
- package/dist/storage/objectStorageConfig.test.d.ts +0 -1
- package/dist/storage/objectStorageConfig.test.js +0 -50
- package/dist/storage/postgresAdapter.test.d.ts +0 -1
- package/dist/storage/postgresAdapter.test.js +0 -29
- package/dist/storage/workspaceAssetStore.test.d.ts +0 -1
- package/dist/storage/workspaceAssetStore.test.js +0 -588
- package/dist/sync/cloudSyncApi.test.d.ts +0 -1
- package/dist/sync/cloudSyncApi.test.js +0 -111
- package/dist/sync/collaborationSyncPayload.test.d.ts +0 -1
- package/dist/sync/collaborationSyncPayload.test.js +0 -125
- package/dist/sync/contentSyncPayload.test.d.ts +0 -1
- package/dist/sync/contentSyncPayload.test.js +0 -143
- package/dist/sync/encryptionService.test.d.ts +0 -1
- package/dist/sync/encryptionService.test.js +0 -52
- package/dist/sync/planningSyncPayload.test.d.ts +0 -1
- package/dist/sync/planningSyncPayload.test.js +0 -92
- package/dist/sync/realtimeFeature.test.d.ts +0 -1
- package/dist/sync/realtimeFeature.test.js +0 -30
- package/dist/sync/realtimeReconcile.test.d.ts +0 -1
- package/dist/sync/realtimeReconcile.test.js +0 -43
- package/dist/sync/syncApplyHandlers.test.d.ts +0 -1
- package/dist/sync/syncApplyHandlers.test.js +0 -626
- package/dist/sync/syncService.test.d.ts +0 -1
- package/dist/sync/syncService.test.js +0 -903
- package/dist/sync/taskSyncPayload.test.d.ts +0 -1
- package/dist/sync/taskSyncPayload.test.js +0 -54
- package/dist/sync/workspacePullFeed.test.d.ts +0 -1
- package/dist/sync/workspacePullFeed.test.js +0 -438
- package/dist/sync/workspaceSyncModel.test.d.ts +0 -1
- package/dist/sync/workspaceSyncModel.test.js +0 -1442
- package/dist/test/setup.d.ts +0 -1
- package/dist/test/setup.js +0 -15
- package/dist/ui/assets/AgentsModule-BS4Pi_nC.js +0 -1
- package/dist/ui/assets/ContextAttachmentManager-CfG_ER7C.js +0 -3
- package/dist/ui/assets/PlansPage-B_z-D6Nh.css +0 -1
- package/dist/ui/assets/PlansPage-Ndt7mYfo.js +0 -1
- package/dist/ui/assets/documentReferences-BOUcJm6-.js +0 -1
- package/dist/ui/assets/index-MAHKvFqp.js +0 -4
- package/dist/utils/accountProfileSummaryCache.test.d.ts +0 -1
- package/dist/utils/accountProfileSummaryCache.test.js +0 -63
- package/dist/utils/annotatedAttachments.test.d.ts +0 -1
- package/dist/utils/annotatedAttachments.test.js +0 -108
- package/dist/utils/assignees.test.d.ts +0 -1
- package/dist/utils/assignees.test.js +0 -25
- package/dist/utils/avatarUpload.test.d.ts +0 -1
- package/dist/utils/avatarUpload.test.js +0 -40
- package/dist/utils/canonicalAssetKind.test.d.ts +0 -1
- package/dist/utils/canonicalAssetKind.test.js +0 -24
- package/dist/utils/coalescedRefresh.test.d.ts +0 -1
- package/dist/utils/coalescedRefresh.test.js +0 -30
- package/dist/utils/constants.icons.test.d.ts +0 -1
- package/dist/utils/constants.icons.test.js +0 -41
- package/dist/utils/planParser.test.d.ts +0 -1
- package/dist/utils/planParser.test.js +0 -183
- package/dist/utils/planningReferences.test.d.ts +0 -1
- package/dist/utils/planningReferences.test.js +0 -17
- package/dist/utils/syncEventDetails.test.d.ts +0 -1
- package/dist/utils/syncEventDetails.test.js +0 -23
- package/dist/utils/syncEventPresentation.test.d.ts +0 -1
- package/dist/utils/syncEventPresentation.test.js +0 -64
- package/dist/utils/syncStatusPresentation.test.d.ts +0 -1
- package/dist/utils/syncStatusPresentation.test.js +0 -164
- package/dist/utils/taskActivity.test.d.ts +0 -1
- package/dist/utils/taskActivity.test.js +0 -218
- package/dist/utils/taskDraftDefaults.test.d.ts +0 -1
- package/dist/utils/taskDraftDefaults.test.js +0 -34
- package/dist/utils/taskDragZones.test.d.ts +0 -1
- package/dist/utils/taskDragZones.test.js +0 -14
- package/dist/utils/taskNormalization.test.d.ts +0 -1
- package/dist/utils/taskNormalization.test.js +0 -158
- package/dist/utils/taskSearch.test.d.ts +0 -1
- package/dist/utils/taskSearch.test.js +0 -69
- package/dist/utils/taskUtils.test.d.ts +0 -1
- package/dist/utils/taskUtils.test.js +0 -19
- package/dist/utils/taskforceApiClient.test.d.ts +0 -1
- package/dist/utils/taskforceApiClient.test.js +0 -44
- package/dist/utils/taxonomyFormDefaults.test.d.ts +0 -1
- package/dist/utils/taxonomyFormDefaults.test.js +0 -63
- package/dist/utils/uiNotice.test.d.ts +0 -1
- package/dist/utils/uiNotice.test.js +0 -18
- package/dist/utils/workspaceIdentity.test.d.ts +0 -1
- package/dist/utils/workspaceIdentity.test.js +0 -61
- package/dist/utils/workspaceLifecycle.test.d.ts +0 -1
- package/dist/utils/workspaceLifecycle.test.js +0 -64
- package/dist/utils/workspaceSyncPresentation.test.d.ts +0 -1
- package/dist/utils/workspaceSyncPresentation.test.js +0 -71
- package/scripts/bootstrap-playwright-auth.mjs +0 -155
- package/scripts/check-cloud-mcp.mjs +0 -83
- package/scripts/check-compat-boundaries.mjs +0 -41
- package/scripts/check-env.ts +0 -31
- package/scripts/check-localization-strings.mjs +0 -49
- package/scripts/check-runtime-boundaries.mjs +0 -44
- package/scripts/debug-global.mjs +0 -34
- package/scripts/debug-login.mjs +0 -32
- package/scripts/debug-server.mjs +0 -36
- package/scripts/deploy-prod.sh +0 -41
- package/scripts/deploy-staging.sh +0 -23
- package/scripts/export-sqlite-to-postgres.mjs +0 -123
- package/scripts/generate-env-example.ts +0 -8
- package/scripts/mcp-stdio-adapter.mjs +0 -160
- package/scripts/migrate-task-data-assets.mjs +0 -408
- package/scripts/playwright-auth.sh +0 -19
- package/scripts/qa-open-lib.mjs +0 -175
- package/scripts/qa-open-lib.mjs.d.ts +0 -49
- package/scripts/qa-open.mjs +0 -352
- package/scripts/release-version-lib.mjs +0 -88
- package/scripts/release-version.mjs +0 -72
- package/scripts/run-billing-performance-smoke.sh +0 -24
- package/scripts/run-dev-proxy.sh +0 -51
- package/scripts/run-e2e-realtime.sh +0 -30
- package/scripts/run-smoke.sh +0 -35
- package/scripts/run-soak.sh +0 -41
- package/scripts/test-global.js +0 -143
- package/scripts/update-homebrew-formula.sh +0 -108
- package/scripts/with-esbuild.sh +0 -11
|
@@ -1,757 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
|
|
3
|
-
import { within } from '@testing-library/react';
|
|
4
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
|
-
import { PlanComparisonPage } from './PlanComparisonPage';
|
|
6
|
-
describe('PlanComparisonPage', () => {
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
globalThis.__DEBUG_MODE__ = false;
|
|
9
|
-
vi.stubGlobal('fetch', vi.fn(async () => ({
|
|
10
|
-
ok: true,
|
|
11
|
-
json: async () => ({
|
|
12
|
-
pageTitle: 'Subscription Plans',
|
|
13
|
-
pageDescription: 'Manage your subscription and explore available features. Your current plan is highlighted below.',
|
|
14
|
-
pricingSource: {
|
|
15
|
-
environment: 'production',
|
|
16
|
-
runtimeMode: 'cloud'
|
|
17
|
-
},
|
|
18
|
-
plans: [
|
|
19
|
-
{
|
|
20
|
-
planId: 'free',
|
|
21
|
-
displayName: 'Free',
|
|
22
|
-
description: 'Start using Taskforce at no cost.',
|
|
23
|
-
status: 'active',
|
|
24
|
-
defaultVersion: {
|
|
25
|
-
planVersionId: 'free-v1',
|
|
26
|
-
versionNumber: 1,
|
|
27
|
-
seatLimit: null,
|
|
28
|
-
metadata: {}
|
|
29
|
-
},
|
|
30
|
-
features: [],
|
|
31
|
-
pricing: {
|
|
32
|
-
month: { pricingType: 'free', stripePriceId: null, unitAmount: null, currency: null, interval: 'month' },
|
|
33
|
-
year: null
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
planId: 'team-5',
|
|
38
|
-
displayName: 'Team 5',
|
|
39
|
-
description: 'For small collaborative teams.',
|
|
40
|
-
status: 'active',
|
|
41
|
-
defaultVersion: {
|
|
42
|
-
planVersionId: 'team-5-v2',
|
|
43
|
-
versionNumber: 2,
|
|
44
|
-
seatLimit: 5,
|
|
45
|
-
metadata: {}
|
|
46
|
-
},
|
|
47
|
-
features: [],
|
|
48
|
-
pricing: {
|
|
49
|
-
month: { pricingType: 'stripe', stripePriceId: 'price_team_5_month', unitAmount: 2000, currency: 'usd', interval: 'month' },
|
|
50
|
-
year: { pricingType: 'stripe', stripePriceId: 'price_team_5_year', unitAmount: 20000, currency: 'usd', interval: 'year' }
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
})
|
|
55
|
-
})));
|
|
56
|
-
});
|
|
57
|
-
afterEach(() => {
|
|
58
|
-
delete globalThis.__DEBUG_MODE__;
|
|
59
|
-
vi.unstubAllGlobals();
|
|
60
|
-
});
|
|
61
|
-
it('shows pricing source details only when debug mode is enabled', async () => {
|
|
62
|
-
globalThis.__DEBUG_MODE__ = true;
|
|
63
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
64
|
-
expect(await screen.findByText('Pricing source: production (cloud)')).toBeInTheDocument();
|
|
65
|
-
});
|
|
66
|
-
it('renders plan descriptions when provided by the pricing payload', async () => {
|
|
67
|
-
const { container } = render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
68
|
-
expect(await screen.findByText('Start using Taskforce at no cost.')).toBeInTheDocument();
|
|
69
|
-
expect(screen.getByText('For small collaborative teams.')).toBeInTheDocument();
|
|
70
|
-
expect(screen.getByRole('heading', { name: 'Founding beta' })).toBeInTheDocument();
|
|
71
|
-
expect(screen.getByText(/Taskforce is in founding beta/)).toBeInTheDocument();
|
|
72
|
-
expect(screen.getByText(/Early members get access while the product is still forming/)).toBeInTheDocument();
|
|
73
|
-
expect(screen.getByText('Prices are listed in USD. Taxes may apply.')).toBeInTheDocument();
|
|
74
|
-
expect(screen.getByText('Local install is free on every plan. Cloud limits apply only to hosted workspaces.')).toBeInTheDocument();
|
|
75
|
-
const foundingBeta = screen.getByRole('heading', { name: 'Founding beta' }).closest('section');
|
|
76
|
-
const firstPlanCard = container.querySelector('[data-testid^="plan-card-"]');
|
|
77
|
-
const planCards = container.querySelectorAll('[data-testid^="plan-card-"]');
|
|
78
|
-
const lastPlanCard = planCards[planCards.length - 1];
|
|
79
|
-
const pricingNotes = screen.getByText('Prices are listed in USD. Taxes may apply.').closest('div');
|
|
80
|
-
const cloudCapacity = screen.getByRole('heading', { name: 'Need more cloud capacity?' }).closest('section');
|
|
81
|
-
const teamWorkspacesCard = screen.getByRole('heading', { name: 'Team workspaces are coming soon.' }).closest('div');
|
|
82
|
-
if (!foundingBeta || !firstPlanCard) {
|
|
83
|
-
throw new Error('Expected founding beta copy and a plan card to render.');
|
|
84
|
-
}
|
|
85
|
-
if (!lastPlanCard || !pricingNotes) {
|
|
86
|
-
throw new Error('Expected pricing notes to render below the plan cards.');
|
|
87
|
-
}
|
|
88
|
-
if (!cloudCapacity || !teamWorkspacesCard) {
|
|
89
|
-
throw new Error('Expected cloud capacity copy to render above the team workspaces card.');
|
|
90
|
-
}
|
|
91
|
-
expect(Boolean(foundingBeta.compareDocumentPosition(firstPlanCard) & Node.DOCUMENT_POSITION_FOLLOWING)).toBe(true);
|
|
92
|
-
expect(Boolean(lastPlanCard.compareDocumentPosition(pricingNotes) & Node.DOCUMENT_POSITION_FOLLOWING)).toBe(true);
|
|
93
|
-
expect(Boolean(pricingNotes.compareDocumentPosition(cloudCapacity) & Node.DOCUMENT_POSITION_FOLLOWING)).toBe(true);
|
|
94
|
-
expect(Boolean(cloudCapacity.compareDocumentPosition(teamWorkspacesCard) & Node.DOCUMENT_POSITION_FOLLOWING)).toBe(true);
|
|
95
|
-
});
|
|
96
|
-
it('renders pricing above the plan description', async () => {
|
|
97
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
98
|
-
const teamCard = await screen.findByTestId('plan-card-team-5');
|
|
99
|
-
const monthlyPrice = within(teamCard).getByText('$20');
|
|
100
|
-
const description = within(teamCard).getByText('For small collaborative teams.');
|
|
101
|
-
expect(Boolean(monthlyPrice.compareDocumentPosition(description) & Node.DOCUMENT_POSITION_FOLLOWING)).toBe(true);
|
|
102
|
-
});
|
|
103
|
-
it('shows founding offer pricing when campaign prices are present', async () => {
|
|
104
|
-
vi.stubGlobal('fetch', vi.fn(async () => ({
|
|
105
|
-
ok: true,
|
|
106
|
-
json: async () => ({
|
|
107
|
-
plans: [
|
|
108
|
-
{
|
|
109
|
-
planId: 'pro',
|
|
110
|
-
displayName: 'Pro',
|
|
111
|
-
description: 'For serious operators.',
|
|
112
|
-
status: 'active',
|
|
113
|
-
defaultVersion: {
|
|
114
|
-
planVersionId: 'pro-v1',
|
|
115
|
-
versionNumber: 1,
|
|
116
|
-
seatLimit: null,
|
|
117
|
-
metadata: {}
|
|
118
|
-
},
|
|
119
|
-
features: [],
|
|
120
|
-
pricing: {
|
|
121
|
-
month: { pricingType: 'stripe', stripePriceId: 'price_pro_month', unitAmount: 3000, currency: 'usd', interval: 'month' },
|
|
122
|
-
year: null
|
|
123
|
-
},
|
|
124
|
-
campaignPricing: {
|
|
125
|
-
month: { pricingType: 'stripe', stripePriceId: 'price_pro_campaign_month', unitAmount: 1200, currency: 'usd', interval: 'month' },
|
|
126
|
-
year: null
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
]
|
|
130
|
-
})
|
|
131
|
-
})));
|
|
132
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
133
|
-
const proCard = await screen.findByTestId('plan-card-pro');
|
|
134
|
-
expect(within(proCard).getByText('$30')).toBeInTheDocument();
|
|
135
|
-
expect(within(proCard).getByText('Founding Offer:')).toBeInTheDocument();
|
|
136
|
-
expect(within(proCard).getByText('$12')).toBeInTheDocument();
|
|
137
|
-
expect(within(proCard).getAllByText('/ month')).toHaveLength(2);
|
|
138
|
-
});
|
|
139
|
-
it('renders and selects campaign-only pricing intervals', async () => {
|
|
140
|
-
const onSelectPlan = vi.fn();
|
|
141
|
-
vi.stubGlobal('fetch', vi.fn(async () => ({
|
|
142
|
-
ok: true,
|
|
143
|
-
json: async () => ({
|
|
144
|
-
plans: [
|
|
145
|
-
{
|
|
146
|
-
planId: 'pro',
|
|
147
|
-
displayName: 'Pro',
|
|
148
|
-
description: 'For serious operators.',
|
|
149
|
-
status: 'active',
|
|
150
|
-
defaultVersion: {
|
|
151
|
-
planVersionId: 'pro-v1',
|
|
152
|
-
versionNumber: 1,
|
|
153
|
-
seatLimit: null,
|
|
154
|
-
metadata: {}
|
|
155
|
-
},
|
|
156
|
-
features: [],
|
|
157
|
-
pricing: {
|
|
158
|
-
month: null,
|
|
159
|
-
year: null
|
|
160
|
-
},
|
|
161
|
-
campaignPricing: {
|
|
162
|
-
month: { pricingType: 'stripe', stripePriceId: 'price_pro_campaign_month', unitAmount: 1200, currency: 'usd', interval: 'month' },
|
|
163
|
-
year: null
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
]
|
|
167
|
-
})
|
|
168
|
-
})));
|
|
169
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: onSelectPlan }));
|
|
170
|
-
const proCard = await screen.findByTestId('plan-card-pro');
|
|
171
|
-
expect(within(proCard).queryByText('$30')).not.toBeInTheDocument();
|
|
172
|
-
expect(within(proCard).getByText('Founding Offer:')).toBeInTheDocument();
|
|
173
|
-
expect(within(proCard).getByText('$12')).toBeInTheDocument();
|
|
174
|
-
fireEvent.click(within(proCard).getByRole('button', { name: 'Get Started' }));
|
|
175
|
-
expect(onSelectPlan).toHaveBeenCalledWith({
|
|
176
|
-
planId: 'pro',
|
|
177
|
-
planVersionId: 'pro-v1',
|
|
178
|
-
interval: 'month',
|
|
179
|
-
pricingType: 'stripe',
|
|
180
|
-
pricingAudience: 'campaign',
|
|
181
|
-
isCurrentPlan: false
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
it('prefers pricing payload header copy when provided', async () => {
|
|
185
|
-
vi.stubGlobal('fetch', vi.fn(async () => ({
|
|
186
|
-
ok: true,
|
|
187
|
-
json: async () => ({
|
|
188
|
-
pageTitle: 'Choose Your Taskforce Plan',
|
|
189
|
-
pageDescription: 'Compare plans and pick the right fit for your team.',
|
|
190
|
-
pricingSource: {
|
|
191
|
-
environment: 'production',
|
|
192
|
-
runtimeMode: 'cloud'
|
|
193
|
-
},
|
|
194
|
-
plans: []
|
|
195
|
-
})
|
|
196
|
-
})));
|
|
197
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", subtitle: "Fallback subtitle", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
198
|
-
expect(await screen.findByRole('heading', { name: 'Choose Your Taskforce Plan' })).toBeInTheDocument();
|
|
199
|
-
expect(screen.getByText('Compare plans and pick the right fit for your team.')).toBeInTheDocument();
|
|
200
|
-
});
|
|
201
|
-
it('can keep the provided heading when pricing payload title exists', async () => {
|
|
202
|
-
vi.stubGlobal('fetch', vi.fn(async () => ({
|
|
203
|
-
ok: true,
|
|
204
|
-
json: async () => ({
|
|
205
|
-
pageTitle: 'Choose Your Taskforce Plan',
|
|
206
|
-
pricingSource: {
|
|
207
|
-
environment: 'production',
|
|
208
|
-
runtimeMode: 'cloud'
|
|
209
|
-
},
|
|
210
|
-
plans: []
|
|
211
|
-
})
|
|
212
|
-
})));
|
|
213
|
-
render(_jsx(PlanComparisonPage, { heading: "Pricing for human-agent work.", preferPricingPageTitle: false, isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
214
|
-
expect(await screen.findByRole('heading', { name: 'Pricing for human-agent work.' })).toBeInTheDocument();
|
|
215
|
-
expect(screen.queryByRole('heading', { name: 'Choose Your Taskforce Plan' })).not.toBeInTheDocument();
|
|
216
|
-
});
|
|
217
|
-
it('renders pricing payload description as sanitized HTML', async () => {
|
|
218
|
-
vi.stubGlobal('fetch', vi.fn(async () => ({
|
|
219
|
-
ok: true,
|
|
220
|
-
json: async () => ({
|
|
221
|
-
pageTitle: 'Choose Your Taskforce Plan',
|
|
222
|
-
pageDescription: '<p>Local install is <strong>free</strong>.</p><p><a href="https://example.com/pricing">Read more</a><a href="javascript:alert(1)">Nope</a></p><script>alert(1)</script>',
|
|
223
|
-
plans: []
|
|
224
|
-
})
|
|
225
|
-
})));
|
|
226
|
-
const { container } = render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", subtitle: "Fallback subtitle", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
227
|
-
expect(await screen.findByText(/Local install is/)).toBeInTheDocument();
|
|
228
|
-
expect(container.querySelector('strong')?.textContent).toBe('free');
|
|
229
|
-
expect(container.querySelector('script')).toBeNull();
|
|
230
|
-
expect(screen.queryByText('alert(1)')).not.toBeInTheDocument();
|
|
231
|
-
expect(container.querySelector('a[href="https://example.com/pricing"]')?.textContent).toBe('Read more');
|
|
232
|
-
expect(container.querySelector('a[href^="javascript:"]')).toBeNull();
|
|
233
|
-
expect(screen.getByText('Nope')).toBeInTheDocument();
|
|
234
|
-
});
|
|
235
|
-
it('falls back to provided pricing source details when the pricing response omits them', async () => {
|
|
236
|
-
globalThis.__DEBUG_MODE__ = true;
|
|
237
|
-
vi.stubGlobal('fetch', vi.fn(async () => ({
|
|
238
|
-
ok: true,
|
|
239
|
-
json: async () => ({
|
|
240
|
-
plans: [
|
|
241
|
-
{
|
|
242
|
-
planId: 'free',
|
|
243
|
-
displayName: 'Free',
|
|
244
|
-
status: 'active',
|
|
245
|
-
defaultVersion: {
|
|
246
|
-
planVersionId: 'free-v1',
|
|
247
|
-
versionNumber: 1,
|
|
248
|
-
seatLimit: null,
|
|
249
|
-
metadata: {}
|
|
250
|
-
},
|
|
251
|
-
features: [],
|
|
252
|
-
pricing: {
|
|
253
|
-
month: { pricingType: 'free', stripePriceId: null, unitAmount: null, currency: null, interval: 'month' },
|
|
254
|
-
year: null
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
]
|
|
258
|
-
})
|
|
259
|
-
})));
|
|
260
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, fallbackPricingSource: { environment: 'performance', runtimeMode: 'local' }, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
261
|
-
expect(await screen.findByText('Pricing source: performance (local)')).toBeInTheDocument();
|
|
262
|
-
});
|
|
263
|
-
it('keeps pricing source details hidden when debug mode is disabled', async () => {
|
|
264
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
265
|
-
await screen.findByRole('heading', { name: 'Subscription Plans' });
|
|
266
|
-
expect(screen.queryByText('Pricing source: production (cloud)')).not.toBeInTheDocument();
|
|
267
|
-
});
|
|
268
|
-
it('renders public feature copy when provided by the pricing payload', async () => {
|
|
269
|
-
vi.stubGlobal('fetch', vi.fn(async () => ({
|
|
270
|
-
ok: true,
|
|
271
|
-
json: async () => ({
|
|
272
|
-
pricingSource: {
|
|
273
|
-
environment: 'production',
|
|
274
|
-
runtimeMode: 'cloud'
|
|
275
|
-
},
|
|
276
|
-
plans: [
|
|
277
|
-
{
|
|
278
|
-
planId: 'team-5',
|
|
279
|
-
displayName: 'Team 5',
|
|
280
|
-
status: 'active',
|
|
281
|
-
defaultVersion: {
|
|
282
|
-
planVersionId: 'team-5-v2',
|
|
283
|
-
versionNumber: 2,
|
|
284
|
-
seatLimit: 5,
|
|
285
|
-
metadata: {}
|
|
286
|
-
},
|
|
287
|
-
features: [
|
|
288
|
-
{
|
|
289
|
-
featureKey: 'collaboration.ai_profiles',
|
|
290
|
-
access: 'enabled',
|
|
291
|
-
label: 'AI Profiles',
|
|
292
|
-
publicLabel: 'AI teammates',
|
|
293
|
-
publicDescription: 'Add reusable AI teammates to your workspace.',
|
|
294
|
-
publicDescriptionVisible: true
|
|
295
|
-
}
|
|
296
|
-
],
|
|
297
|
-
pricing: {
|
|
298
|
-
month: { pricingType: 'stripe', stripePriceId: 'price_team_5_month', unitAmount: 2000, currency: 'usd', interval: 'month' },
|
|
299
|
-
year: null
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
]
|
|
303
|
-
})
|
|
304
|
-
})));
|
|
305
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
306
|
-
expect(await screen.findByText('AI teammates')).toBeInTheDocument();
|
|
307
|
-
expect(screen.getByText('Add reusable AI teammates to your workspace.')).toBeInTheDocument();
|
|
308
|
-
expect(screen.queryByText('Collaboration Ai Profiles')).not.toBeInTheDocument();
|
|
309
|
-
});
|
|
310
|
-
it('hides feature descriptions when publicDescriptionVisible is false', async () => {
|
|
311
|
-
vi.stubGlobal('fetch', vi.fn(async () => ({
|
|
312
|
-
ok: true,
|
|
313
|
-
json: async () => ({
|
|
314
|
-
pricingSource: {
|
|
315
|
-
environment: 'production',
|
|
316
|
-
runtimeMode: 'cloud'
|
|
317
|
-
},
|
|
318
|
-
plans: [
|
|
319
|
-
{
|
|
320
|
-
planId: 'team-5',
|
|
321
|
-
displayName: 'Team 5',
|
|
322
|
-
status: 'active',
|
|
323
|
-
defaultVersion: {
|
|
324
|
-
planVersionId: 'team-5-v2',
|
|
325
|
-
versionNumber: 2,
|
|
326
|
-
seatLimit: 5,
|
|
327
|
-
metadata: {}
|
|
328
|
-
},
|
|
329
|
-
features: [
|
|
330
|
-
{
|
|
331
|
-
featureKey: 'collaboration.ai_profiles',
|
|
332
|
-
access: 'enabled',
|
|
333
|
-
label: 'AI Profiles',
|
|
334
|
-
publicLabel: 'AI teammates',
|
|
335
|
-
publicDescription: 'Add reusable AI teammates to your workspace.',
|
|
336
|
-
publicDescriptionVisible: false
|
|
337
|
-
}
|
|
338
|
-
],
|
|
339
|
-
pricing: {
|
|
340
|
-
month: { pricingType: 'stripe', stripePriceId: 'price_team_5_month', unitAmount: 2000, currency: 'usd', interval: 'month' },
|
|
341
|
-
year: null
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
]
|
|
345
|
-
})
|
|
346
|
-
})));
|
|
347
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
348
|
-
expect(await screen.findByText('AI teammates')).toBeInTheDocument();
|
|
349
|
-
expect(screen.queryByText('Add reusable AI teammates to your workspace.')).not.toBeInTheDocument();
|
|
350
|
-
});
|
|
351
|
-
it('renders inline numeric feature limits next to each feature label', async () => {
|
|
352
|
-
vi.stubGlobal('fetch', vi.fn(async () => ({
|
|
353
|
-
ok: true,
|
|
354
|
-
json: async () => ({
|
|
355
|
-
pricingSource: {
|
|
356
|
-
environment: 'production',
|
|
357
|
-
runtimeMode: 'cloud'
|
|
358
|
-
},
|
|
359
|
-
plans: [
|
|
360
|
-
{
|
|
361
|
-
planId: 'free',
|
|
362
|
-
displayName: 'Free',
|
|
363
|
-
status: 'active',
|
|
364
|
-
defaultVersion: {
|
|
365
|
-
planVersionId: 'free-v1',
|
|
366
|
-
versionNumber: 1,
|
|
367
|
-
seatLimit: 12,
|
|
368
|
-
metadata: {}
|
|
369
|
-
},
|
|
370
|
-
features: [
|
|
371
|
-
{
|
|
372
|
-
featureKey: 'workspace.workspaces',
|
|
373
|
-
access: 'enabled',
|
|
374
|
-
label: 'Workspaces',
|
|
375
|
-
config: { maxWorkspaces: 1 }
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
featureKey: 'collaboration.ai_profiles',
|
|
379
|
-
access: 'limited',
|
|
380
|
-
label: 'AI Profiles',
|
|
381
|
-
publicLabel: 'AI Agents',
|
|
382
|
-
config: { maxAiProfiles: 4 }
|
|
383
|
-
},
|
|
384
|
-
{
|
|
385
|
-
featureKey: 'context.uploads',
|
|
386
|
-
access: 'enabled',
|
|
387
|
-
label: 'Cloud Storage',
|
|
388
|
-
config: { storageLimitMb: 24 }
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
featureKey: 'collaboration.team_management',
|
|
392
|
-
access: 'enabled',
|
|
393
|
-
label: 'Team Management'
|
|
394
|
-
}
|
|
395
|
-
],
|
|
396
|
-
pricing: {
|
|
397
|
-
month: { pricingType: 'free', stripePriceId: null, unitAmount: null, currency: null, interval: 'month' },
|
|
398
|
-
year: null
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
]
|
|
402
|
-
})
|
|
403
|
-
})));
|
|
404
|
-
const { container } = render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
405
|
-
const freeCard = await screen.findByTestId('plan-card-free');
|
|
406
|
-
const featureTextNodes = Array.from(freeCard.querySelectorAll('span')).map((node) => node.textContent);
|
|
407
|
-
expect(featureTextNodes).toContain('1 Workspace');
|
|
408
|
-
expect(featureTextNodes).toContain('4 AI Agents');
|
|
409
|
-
expect(featureTextNodes).toContain('24MB Cloud Storage');
|
|
410
|
-
expect(featureTextNodes).toContain('12 Team Management');
|
|
411
|
-
expect(container.querySelector('[class*="featureLimitUnit"]')?.textContent).toBe('MB');
|
|
412
|
-
});
|
|
413
|
-
it('renders the storage unit suffix in a smaller accent span', async () => {
|
|
414
|
-
vi.stubGlobal('fetch', vi.fn(async () => ({
|
|
415
|
-
ok: true,
|
|
416
|
-
json: async () => ({
|
|
417
|
-
pricingSource: {
|
|
418
|
-
environment: 'production',
|
|
419
|
-
runtimeMode: 'cloud'
|
|
420
|
-
},
|
|
421
|
-
plans: [
|
|
422
|
-
{
|
|
423
|
-
planId: 'free',
|
|
424
|
-
displayName: 'Free',
|
|
425
|
-
status: 'active',
|
|
426
|
-
defaultVersion: {
|
|
427
|
-
planVersionId: 'free-v1',
|
|
428
|
-
versionNumber: 1,
|
|
429
|
-
seatLimit: null,
|
|
430
|
-
metadata: {}
|
|
431
|
-
},
|
|
432
|
-
features: [
|
|
433
|
-
{
|
|
434
|
-
featureKey: 'context.uploads',
|
|
435
|
-
access: 'enabled',
|
|
436
|
-
label: 'Cloud Storage',
|
|
437
|
-
config: { storageLimitMb: 64 }
|
|
438
|
-
}
|
|
439
|
-
],
|
|
440
|
-
pricing: {
|
|
441
|
-
month: { pricingType: 'free', stripePriceId: null, unitAmount: null, currency: null, interval: 'month' },
|
|
442
|
-
year: null
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
]
|
|
446
|
-
})
|
|
447
|
-
})));
|
|
448
|
-
const { container } = render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
449
|
-
await screen.findByText('Cloud Storage');
|
|
450
|
-
const accent = container.querySelector('[class*="featureLimitAccent"]');
|
|
451
|
-
const unit = container.querySelector('[class*="featureLimitUnit"]');
|
|
452
|
-
expect(accent?.textContent).toBe('64MB');
|
|
453
|
-
expect(unit?.textContent).toBe('MB');
|
|
454
|
-
});
|
|
455
|
-
it('renders storage limits above 1000 MB as rounded GB', async () => {
|
|
456
|
-
vi.stubGlobal('fetch', vi.fn(async () => ({
|
|
457
|
-
ok: true,
|
|
458
|
-
json: async () => ({
|
|
459
|
-
pricingSource: {
|
|
460
|
-
environment: 'production',
|
|
461
|
-
runtimeMode: 'cloud'
|
|
462
|
-
},
|
|
463
|
-
plans: [
|
|
464
|
-
{
|
|
465
|
-
planId: 'pro',
|
|
466
|
-
displayName: 'Pro',
|
|
467
|
-
status: 'active',
|
|
468
|
-
defaultVersion: {
|
|
469
|
-
planVersionId: 'pro-v1',
|
|
470
|
-
versionNumber: 1,
|
|
471
|
-
seatLimit: null,
|
|
472
|
-
metadata: {}
|
|
473
|
-
},
|
|
474
|
-
features: [
|
|
475
|
-
{
|
|
476
|
-
featureKey: 'context.uploads',
|
|
477
|
-
access: 'enabled',
|
|
478
|
-
label: 'Cloud Storage',
|
|
479
|
-
config: { storageLimitMb: 2500 }
|
|
480
|
-
}
|
|
481
|
-
],
|
|
482
|
-
pricing: {
|
|
483
|
-
month: { pricingType: 'stripe', stripePriceId: 'price_pro_month', unitAmount: 1999, currency: 'usd', interval: 'month' },
|
|
484
|
-
year: null
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
]
|
|
488
|
-
})
|
|
489
|
-
})));
|
|
490
|
-
const { container } = render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
491
|
-
await screen.findByText('Cloud Storage');
|
|
492
|
-
const accent = container.querySelector('[class*="featureLimitAccent"]');
|
|
493
|
-
const unit = container.querySelector('[class*="featureLimitUnit"]');
|
|
494
|
-
expect(accent?.textContent).toBe('3GB');
|
|
495
|
-
expect(unit?.textContent).toBe('GB');
|
|
496
|
-
});
|
|
497
|
-
it('hides missing yearly pricing rows and buttons instead of rendering unavailable state', async () => {
|
|
498
|
-
vi.stubGlobal('fetch', vi.fn(async () => ({
|
|
499
|
-
ok: true,
|
|
500
|
-
json: async () => ({
|
|
501
|
-
pricingSource: {
|
|
502
|
-
environment: 'production',
|
|
503
|
-
runtimeMode: 'cloud'
|
|
504
|
-
},
|
|
505
|
-
plans: [
|
|
506
|
-
{
|
|
507
|
-
planId: 'operator',
|
|
508
|
-
displayName: 'Operator',
|
|
509
|
-
status: 'active',
|
|
510
|
-
defaultVersion: {
|
|
511
|
-
planVersionId: 'operator-v1',
|
|
512
|
-
versionNumber: 1,
|
|
513
|
-
seatLimit: null,
|
|
514
|
-
metadata: {}
|
|
515
|
-
},
|
|
516
|
-
features: [],
|
|
517
|
-
pricing: {
|
|
518
|
-
month: { pricingType: 'stripe', stripePriceId: 'price_operator_month', unitAmount: 999, currency: 'usd', interval: 'month' },
|
|
519
|
-
year: null
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
]
|
|
523
|
-
})
|
|
524
|
-
})));
|
|
525
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: true, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
526
|
-
const operatorCard = await screen.findByTestId('plan-card-operator');
|
|
527
|
-
expect(within(operatorCard).getByText('$9.99')).toBeInTheDocument();
|
|
528
|
-
expect(within(operatorCard).getByText('/ month')).toBeInTheDocument();
|
|
529
|
-
expect(within(operatorCard).queryByText('/ year')).not.toBeInTheDocument();
|
|
530
|
-
expect(within(operatorCard).queryByText('Unavailable')).not.toBeInTheDocument();
|
|
531
|
-
expect(within(operatorCard).getByRole('button', { name: 'Get Started' })).toBeInTheDocument();
|
|
532
|
-
expect(within(operatorCard).queryByRole('button', { name: 'Start Yearly' })).not.toBeInTheDocument();
|
|
533
|
-
});
|
|
534
|
-
it('does not mark a plan current when only the plan id matches but the version does not', async () => {
|
|
535
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: true, currentPlanId: "team-5", currentPlanVersionId: "team-5-v1", currentEntitlementState: "active", onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
536
|
-
expect(await screen.findByRole('heading', { name: 'Subscription Plans' })).toBeInTheDocument();
|
|
537
|
-
expect(screen.queryByText('Current Plan')).not.toBeInTheDocument();
|
|
538
|
-
});
|
|
539
|
-
it('marks a trialing entitlement as the current plan', async () => {
|
|
540
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: true, currentPlanId: "team-5", currentPlanVersionId: "team-5-v2", currentEntitlementState: "trialing", onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
541
|
-
expect(await screen.findByRole('heading', { name: 'Subscription Plans' })).toBeInTheDocument();
|
|
542
|
-
expect(screen.getByText('Current Plan')).toBeInTheDocument();
|
|
543
|
-
});
|
|
544
|
-
it('can show the current plan as a non-interactive indicator when billing is managed from page chrome', async () => {
|
|
545
|
-
const onSelectPlan = vi.fn();
|
|
546
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: true, currentPlanId: "team-5", currentPlanVersionId: "team-5-v2", currentEntitlementState: "active", canManageCurrentPlan: true, currentPlanCardActionMode: "indicator", onBack: () => { }, backLabel: "Back", onSelectPlan: onSelectPlan }));
|
|
547
|
-
expect(await screen.findByRole('heading', { name: 'Subscription Plans' })).toBeInTheDocument();
|
|
548
|
-
const currentCard = screen.getByTestId('plan-card-team-5');
|
|
549
|
-
expect(currentCard).not.toHaveAttribute('role', 'button');
|
|
550
|
-
expect(screen.queryByTestId('plan-manage-team-5')).not.toBeInTheDocument();
|
|
551
|
-
expect(screen.queryByRole('button', { name: 'Manage Plan' })).not.toBeInTheDocument();
|
|
552
|
-
expect(screen.getByTestId('plan-current-team-5')).toBeDisabled();
|
|
553
|
-
fireEvent.click(currentCard);
|
|
554
|
-
expect(onSelectPlan).not.toHaveBeenCalled();
|
|
555
|
-
});
|
|
556
|
-
it('can render the page header bar even when shell chrome is present', async () => {
|
|
557
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: true, chrome: _jsx("div", { children: "Shell chrome" }), showHeaderBarWithChrome: true, topActions: _jsx("button", { type: "button", children: "Manage billing" }), onBack: () => { }, backLabel: "Back to App", onSelectPlan: () => { } }));
|
|
558
|
-
expect(await screen.findByRole('heading', { name: 'Subscription Plans' })).toBeInTheDocument();
|
|
559
|
-
expect(screen.getByRole('button', { name: 'Back to App' })).toBeInTheDocument();
|
|
560
|
-
expect(screen.getByRole('button', { name: 'Manage billing' })).toBeInTheDocument();
|
|
561
|
-
});
|
|
562
|
-
it('does not mark a canceled entitlement as current through the plan-id fallback path', async () => {
|
|
563
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: true, currentPlanId: "team-5", currentPlanVersionId: null, currentEntitlementState: "canceled", onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
564
|
-
expect(await screen.findByRole('heading', { name: 'Subscription Plans' })).toBeInTheDocument();
|
|
565
|
-
expect(screen.queryByText('Current Plan')).not.toBeInTheDocument();
|
|
566
|
-
});
|
|
567
|
-
it('does not mark a linked pending-plan-selection entitlement as the current plan', async () => {
|
|
568
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: true, currentPlanId: "team-5", currentPlanVersionId: "team-5-v2", currentEntitlementState: "pending_plan_selection", canManageCurrentPlan: true, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
569
|
-
expect(await screen.findByRole('heading', { name: 'Subscription Plans' })).toBeInTheDocument();
|
|
570
|
-
expect(screen.queryByRole('button', { name: 'Manage Plan' })).not.toBeInTheDocument();
|
|
571
|
-
expect(screen.queryByText('Current Plan')).not.toBeInTheDocument();
|
|
572
|
-
expect(screen.getByRole('button', { name: 'Start Monthly' })).toBeInTheDocument();
|
|
573
|
-
});
|
|
574
|
-
it('can disable the page back button while onboarding remains blocked', async () => {
|
|
575
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: true, onBack: () => { }, backLabel: "Back to App", backDisabled: true, onSelectPlan: () => { } }));
|
|
576
|
-
expect(await screen.findByRole('button', { name: 'Back to App' })).toBeDisabled();
|
|
577
|
-
});
|
|
578
|
-
it('shows pricing before auth resolves but keeps plan selection disabled until bootstrap finishes', async () => {
|
|
579
|
-
const onSelectPlan = vi.fn();
|
|
580
|
-
const view = render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, authSessionResolved: false, onBack: () => { }, backLabel: "Back", onSelectPlan: onSelectPlan }));
|
|
581
|
-
expect(await screen.findByRole('heading', { name: 'Subscription Plans' })).toBeInTheDocument();
|
|
582
|
-
const freeCard = screen.getByTestId('plan-card-free');
|
|
583
|
-
expect(screen.getByRole('button', { name: 'Get Started' })).toBeDisabled();
|
|
584
|
-
expect(screen.getByRole('button', { name: 'Start Monthly' })).toBeDisabled();
|
|
585
|
-
expect(screen.getByRole('button', { name: 'Start Yearly' })).toBeDisabled();
|
|
586
|
-
expect(freeCard).not.toHaveAttribute('role', 'button');
|
|
587
|
-
view.rerender(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, authSessionResolved: true, onBack: () => { }, backLabel: "Back", onSelectPlan: onSelectPlan }));
|
|
588
|
-
const enabledFreeCard = screen.getByTestId('plan-card-free');
|
|
589
|
-
expect(screen.getByRole('button', { name: 'Get Started' })).toBeEnabled();
|
|
590
|
-
expect(screen.getByRole('button', { name: 'Start Monthly' })).toBeEnabled();
|
|
591
|
-
expect(screen.getByRole('button', { name: 'Start Yearly' })).toBeEnabled();
|
|
592
|
-
expect(enabledFreeCard).toHaveAttribute('role', 'button');
|
|
593
|
-
fireEvent.click(screen.getByRole('button', { name: 'Get Started' }));
|
|
594
|
-
await waitFor(() => {
|
|
595
|
-
expect(onSelectPlan).toHaveBeenCalledWith({
|
|
596
|
-
planId: 'free',
|
|
597
|
-
planVersionId: 'free-v1',
|
|
598
|
-
interval: 'month',
|
|
599
|
-
pricingType: 'free',
|
|
600
|
-
pricingAudience: 'public',
|
|
601
|
-
isCurrentPlan: false
|
|
602
|
-
});
|
|
603
|
-
});
|
|
604
|
-
});
|
|
605
|
-
it('selects the whole plan card using the default available interval', async () => {
|
|
606
|
-
const onSelectPlan = vi.fn();
|
|
607
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: onSelectPlan }));
|
|
608
|
-
await screen.findByRole('heading', { name: 'Subscription Plans' });
|
|
609
|
-
const freeHeading = screen.getByRole('heading', { name: 'Free' });
|
|
610
|
-
const freeCard = freeHeading.closest('[role="button"]');
|
|
611
|
-
expect(freeCard).toBeTruthy();
|
|
612
|
-
expect(within(freeCard).getByText('$0')).toBeInTheDocument();
|
|
613
|
-
expect(within(freeCard).getByText('/ month')).toBeInTheDocument();
|
|
614
|
-
fireEvent.click(freeCard);
|
|
615
|
-
await waitFor(() => {
|
|
616
|
-
expect(onSelectPlan).toHaveBeenCalledWith({
|
|
617
|
-
planId: 'free',
|
|
618
|
-
planVersionId: 'free-v1',
|
|
619
|
-
interval: 'month',
|
|
620
|
-
pricingType: 'free',
|
|
621
|
-
pricingAudience: 'public',
|
|
622
|
-
isCurrentPlan: false
|
|
623
|
-
});
|
|
624
|
-
});
|
|
625
|
-
});
|
|
626
|
-
it('does not trigger current-plan actions when the current plan is not Stripe-managed', async () => {
|
|
627
|
-
const onSelectPlan = vi.fn();
|
|
628
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: true, currentPlanId: "free", currentPlanVersionId: "free-v1", currentEntitlementState: "active", canManageCurrentPlan: false, onBack: () => { }, backLabel: "Back", onSelectPlan: onSelectPlan }));
|
|
629
|
-
await screen.findByRole('heading', { name: 'Subscription Plans' });
|
|
630
|
-
const currentButton = screen.getByRole('button', { name: 'Current Plan' });
|
|
631
|
-
expect(currentButton).toBeDisabled();
|
|
632
|
-
expect(onSelectPlan).not.toHaveBeenCalled();
|
|
633
|
-
});
|
|
634
|
-
it('loads pricing from the provided cloud endpoint', async () => {
|
|
635
|
-
const fetchMock = vi.fn().mockResolvedValue({
|
|
636
|
-
ok: true,
|
|
637
|
-
json: async () => ({
|
|
638
|
-
pricingSource: {
|
|
639
|
-
environment: 'performance',
|
|
640
|
-
runtimeMode: 'cloud'
|
|
641
|
-
},
|
|
642
|
-
plans: [
|
|
643
|
-
{
|
|
644
|
-
planId: 'free',
|
|
645
|
-
displayName: 'Free',
|
|
646
|
-
status: 'active',
|
|
647
|
-
defaultVersion: {
|
|
648
|
-
planVersionId: 'free-v1',
|
|
649
|
-
versionNumber: 1,
|
|
650
|
-
seatLimit: null,
|
|
651
|
-
metadata: {}
|
|
652
|
-
},
|
|
653
|
-
features: [],
|
|
654
|
-
pricing: {
|
|
655
|
-
month: { pricingType: 'free', stripePriceId: null, unitAmount: 0, currency: null, interval: 'month' },
|
|
656
|
-
year: null
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
]
|
|
660
|
-
})
|
|
661
|
-
});
|
|
662
|
-
vi.stubGlobal('fetch', fetchMock);
|
|
663
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, pricingEndpoint: "https://performance-app.example/api/taskforce/public/pricing", onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
664
|
-
expect(await screen.findByRole('heading', { name: 'Free' })).toBeInTheDocument();
|
|
665
|
-
expect(fetchMock).toHaveBeenCalledTimes(1);
|
|
666
|
-
expect(fetchMock).toHaveBeenCalledWith('https://performance-app.example/api/taskforce/public/pricing', {
|
|
667
|
-
method: 'GET',
|
|
668
|
-
credentials: 'include'
|
|
669
|
-
});
|
|
670
|
-
expect(screen.queryByText('Connecting to plan pricing...')).not.toBeInTheDocument();
|
|
671
|
-
});
|
|
672
|
-
it('orders plans from free to highest priced tier', async () => {
|
|
673
|
-
const fetchMock = vi.fn().mockResolvedValue({
|
|
674
|
-
ok: true,
|
|
675
|
-
json: async () => ({
|
|
676
|
-
pricingSource: {
|
|
677
|
-
environment: 'production',
|
|
678
|
-
runtimeMode: 'cloud'
|
|
679
|
-
},
|
|
680
|
-
plans: [
|
|
681
|
-
{
|
|
682
|
-
planId: 'team-5',
|
|
683
|
-
displayName: 'Team 5',
|
|
684
|
-
status: 'active',
|
|
685
|
-
defaultVersion: {
|
|
686
|
-
planVersionId: 'team-5-v2',
|
|
687
|
-
versionNumber: 3,
|
|
688
|
-
seatLimit: 5,
|
|
689
|
-
metadata: {}
|
|
690
|
-
},
|
|
691
|
-
features: [],
|
|
692
|
-
pricing: {
|
|
693
|
-
month: { pricingType: 'stripe', stripePriceId: 'price_team_5_month', unitAmount: 12000, currency: 'usd', interval: 'month' },
|
|
694
|
-
year: { pricingType: 'stripe', stripePriceId: 'price_team_5_year', unitAmount: 120000, currency: 'usd', interval: 'year' }
|
|
695
|
-
}
|
|
696
|
-
},
|
|
697
|
-
{
|
|
698
|
-
planId: 'free',
|
|
699
|
-
displayName: 'Free',
|
|
700
|
-
status: 'active',
|
|
701
|
-
defaultVersion: {
|
|
702
|
-
planVersionId: 'free-v1',
|
|
703
|
-
versionNumber: 1,
|
|
704
|
-
seatLimit: null,
|
|
705
|
-
metadata: {}
|
|
706
|
-
},
|
|
707
|
-
features: [],
|
|
708
|
-
pricing: {
|
|
709
|
-
month: { pricingType: 'free', stripePriceId: null, unitAmount: 0, currency: null, interval: 'month' },
|
|
710
|
-
year: null
|
|
711
|
-
}
|
|
712
|
-
},
|
|
713
|
-
{
|
|
714
|
-
planId: 'basic',
|
|
715
|
-
displayName: 'Basic',
|
|
716
|
-
status: 'active',
|
|
717
|
-
defaultVersion: {
|
|
718
|
-
planVersionId: 'basic-v1',
|
|
719
|
-
versionNumber: 2,
|
|
720
|
-
seatLimit: 1,
|
|
721
|
-
metadata: {}
|
|
722
|
-
},
|
|
723
|
-
features: [],
|
|
724
|
-
pricing: {
|
|
725
|
-
month: { pricingType: 'stripe', stripePriceId: 'price_basic_month', unitAmount: 3000, currency: 'usd', interval: 'month' },
|
|
726
|
-
year: { pricingType: 'stripe', stripePriceId: 'price_basic_year', unitAmount: 30000, currency: 'usd', interval: 'year' }
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
]
|
|
730
|
-
})
|
|
731
|
-
});
|
|
732
|
-
vi.stubGlobal('fetch', fetchMock);
|
|
733
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
734
|
-
await screen.findByRole('heading', { name: 'Subscription Plans' });
|
|
735
|
-
const planNames = screen.getAllByRole('heading', { level: 3 }).map((node) => node.textContent);
|
|
736
|
-
expect(planNames).toEqual(['Free', 'Basic', 'Team 5']);
|
|
737
|
-
});
|
|
738
|
-
it('defaults to the same-origin pricing endpoint', async () => {
|
|
739
|
-
const fetchMock = vi.fn().mockResolvedValue({
|
|
740
|
-
ok: true,
|
|
741
|
-
json: async () => ({
|
|
742
|
-
pricingSource: {
|
|
743
|
-
environment: 'production',
|
|
744
|
-
runtimeMode: 'cloud'
|
|
745
|
-
},
|
|
746
|
-
plans: []
|
|
747
|
-
})
|
|
748
|
-
});
|
|
749
|
-
vi.stubGlobal('fetch', fetchMock);
|
|
750
|
-
render(_jsx(PlanComparisonPage, { heading: "Subscription Plans", isAuthenticated: false, onBack: () => { }, backLabel: "Back", onSelectPlan: () => { } }));
|
|
751
|
-
await screen.findByText('Paid plans are getting their final polish.');
|
|
752
|
-
expect(fetchMock).toHaveBeenCalledWith('/api/taskforce/public/pricing', {
|
|
753
|
-
method: 'GET',
|
|
754
|
-
credentials: 'include'
|
|
755
|
-
});
|
|
756
|
-
});
|
|
757
|
-
});
|