Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Route monitored-system handoffs to usage review

rcourtmand1e8cab052bf
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index 76d2579dae..94f0f03841 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -294,29 +294,20 @@ Community limit enforcement.
the section, but that summary treatment must stay inside the same task
surface instead of reviving a separate overview panel, summary strip, or
metric deck ahead of the real workspace list.
-23. Keep self-hosted monitored-system warning CTA intents distinct on the owned
- billing surface. `Learn more` links must land on the monitored-system
- usage-focused billing state, while `Upgrade to add more` links must land on
- the plan-focused billing state. The owned billing shell must express those
- states explicitly through canonical route-owned destinations
- (`/settings/system/billing/plan` and `/settings/system/billing/usage`) and
- their rendered content, not through nearby fragments that still present the
- same visible destination. `frontend-modern/src/components/Settings/ProLicensePanel.tsx`
- and `frontend-modern/src/components/Settings/useProLicensePanelState.ts`
- therefore own a canonical two-state billing focus model (`plan` vs
- `usage`) that survives direct links, compatibility redirects, and
- in-product CTA navigation. The current canonical arrivals are
- `/settings/system/billing/usage?details=counting-rules` for explanation and
- `/settings/system/billing/plan?intent=self_hosted_plan` for plan-selection
- intent. That plan-selection arrival must reopen an explicit
- `Compare self-hosted plans` prompt inside Plans & Billing so operators can
- review the self-hosted upgrade path without falling back to the legacy
- usage surface or a dead-end placeholder CTA. The same owned plan route must
- also reopen that compare-plans prompt by default for expired or no-paid
- self-hosted installs, so `Plans & Billing` remains actionable even when the
- operator arrives without an explicit `intent=self_hosted_plan` link.
- That same self-hosted commercial boundary also owns legacy migration
- continuity semantics: `legacy_migration_fallback` may preserve
+23. Keep self-hosted monitored-system capacity review informational and
+ non-commercial. Any monitored-system limit, continuity, or legacy
+ `max_monitored_systems` handoff must land on the usage-focused billing
+ state (`/settings/system/billing/usage?details=counting-rules`) so the
+ operator can inspect counting rules and any support/audit policy context
+ without being pushed toward a purchase. Monitored-system warnings must not
+ surface `Upgrade to add more`, `Compare self-hosted plans`, or the
+ `intent=self_hosted_plan` plan-selection arrival. `frontend-modern/src/components/Settings/ProLicensePanel.tsx`,
+ `frontend-modern/src/components/Settings/useProLicensePanelState.ts`, and
+ `frontend-modern/src/utils/pricingHandoff.ts` therefore own a two-state
+ billing focus model where monitored-system aliases resolve to `usage`, and
+ plan selection is reserved for explicit self-hosted Pro/commercial-extra
+ arrivals. That same self-hosted commercial boundary also owns legacy
+ migration continuity semantics: `legacy_migration_fallback` may preserve
`plan_limit` and `grandfathered_floor` for support/audit context, but
self-hosted v6 monitoring remains uncapped. The canonical contract is
therefore `status.max_monitored_systems = 0`, no enforced
@@ -927,12 +918,15 @@ checkout creation must post only `portal_handoff_id` so Pulse Account
resolves the private checkout intent server-side before contacting Stripe.
For self-hosted upgrades, that browser-facing feature metadata is now
canonically `self_hosted_plan`. Pulse Account may continue normalizing the
-legacy `max_monitored_systems` alias so older handoff links do not break, but
-the portal proxy contract, checked-in embedded bundle, and rendered upgrade
-copy must treat self-hosted commerce as plan selection and paid extras rather
-than monitored-system-cap expansion. Shared helpers and route-owned browser
-symbols should name that state as plan selection as well; the monitored-system
-alias belongs only to backward-compatible handoff normalization.
+legacy `max_monitored_systems` alias only for already-created checkout records,
+but in-product browser links and fallback helpers must route that alias to the
+monitored-system usage/counting-rules surface instead of plan selection. The
+portal proxy contract, checked-in embedded bundle, and rendered upgrade copy
+must treat self-hosted commerce as plan selection and paid extras rather than
+monitored-system-cap expansion. Shared helpers and route-owned browser symbols
+should name that commercial state as plan selection as well; the
+monitored-system alias belongs only to backward-compatible handoff
+normalization and non-commercial usage review.
If Pulse cannot create or resolve that portal handoff locally, the Pulse-owned
start route must still return the operator to the owned billing plan surface
with an explicit `purchase=unavailable` arrival instead of leaving the browser
@@ -1462,8 +1456,8 @@ users must not be funneled through upgrade CTAs inside Settings -> Plan.
`ProLicensePlanSection.tsx` must not render the monitored-system upgrade
arrival banner, the trial-start CTA, or the inactive-Pro upsell notice to
users without paid features, `licensePresentation.ts` must not retain a dead
-inactive-Pro upsell helper for that surface, and the capacity-section `Upgrade
-plan` button must be gated on `hasPaidFeatures`. Self-hosted Pro marketing lives at
+inactive-Pro upsell helper for that surface, and the capacity section must not
+render an upgrade-plan button for monitored-system pressure. Self-hosted Pro marketing lives at
`pulserelay.pro/pricing`; the Settings plan surface must show factual
license state for Community users and leave discovery of paid tiers to
surfaces outside the plan page.
diff --git a/frontend-modern/src/components/shared/__tests__/MonitoredSystemLimitWarningBanner.test.tsx b/frontend-modern/src/components/shared/__tests__/MonitoredSystemLimitWarningBanner.test.tsx
index c75c6c6983..3584dcbfa0 100644
--- a/frontend-modern/src/components/shared/__tests__/MonitoredSystemLimitWarningBanner.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/MonitoredSystemLimitWarningBanner.test.tsx
@@ -101,7 +101,7 @@ describe('MonitoredSystemLimitWarningBanner', () => {
external: false,
});
mockGetUpgradeActionUrlOrFallback.mockReturnValue(
- '/settings/system/billing/plan?intent=self_hosted_plan',
+ '/settings/system/billing/usage?details=counting-rules',
);
});
diff --git a/frontend-modern/src/pages/__tests__/PricingHandoff.test.tsx b/frontend-modern/src/pages/__tests__/PricingHandoff.test.tsx
index 725f4afbfe..a4b9a742a4 100644
--- a/frontend-modern/src/pages/__tests__/PricingHandoff.test.tsx
+++ b/frontend-modern/src/pages/__tests__/PricingHandoff.test.tsx
@@ -13,9 +13,8 @@ vi.mock('@/utils/upgradeMetrics', () => ({
}));
vi.mock('@/utils/pricingHandoff', async () => {
- const actual = await vi.importActual<typeof import('@/utils/pricingHandoff')>(
- '@/utils/pricingHandoff',
- );
+ const actual =
+ await vi.importActual<typeof import('@/utils/pricingHandoff')>('@/utils/pricingHandoff');
return {
...actual,
handoffToExternalPricing: (...args: unknown[]) => handoffToExternalPricingMock(...args),
@@ -34,11 +33,11 @@ describe('PricingHandoff', () => {
window.history.replaceState({}, '', '/');
});
- it('hands self-hosted upgrade requests off to Pulse Account', async () => {
- window.history.replaceState({}, '', '/pricing?feature=relay');
+ it('hands unknown feature requests off to Pulse Account', async () => {
+ window.history.replaceState({}, '', '/pricing?feature=unknown_pro_feature');
const expectedDestination = getSelfHostedPurchaseStartUrl(
- 'relay',
- new URLSearchParams('feature=relay'),
+ 'unknown_pro_feature',
+ new URLSearchParams('feature=unknown_pro_feature'),
);
render(() => (
@@ -48,12 +47,12 @@ describe('PricingHandoff', () => {
));
await waitFor(() => {
- expect(handoffToExternalPricingMock).toHaveBeenCalledWith(
- expectedDestination,
- );
+ expect(handoffToExternalPricingMock).toHaveBeenCalledWith(expectedDestination);
});
- expect(screen.getByRole('heading', { name: 'Redirecting to Pulse Account' })).toBeInTheDocument();
+ expect(
+ screen.getByRole('heading', { name: 'Redirecting to Pulse Account' }),
+ ).toBeInTheDocument();
expect(screen.getByRole('link', { name: /continue to Pulse Account/i })).toHaveAttribute(
'href',
expectedDestination,
@@ -61,19 +60,21 @@ describe('PricingHandoff', () => {
});
it('keeps the pricing handoff on the shared page-header shell', () => {
- expect(pricingHandoffSource).toContain("import { PageHeader } from '@/components/shared/PageHeader';");
+ expect(pricingHandoffSource).toContain(
+ "import { PageHeader } from '@/components/shared/PageHeader';",
+ );
expect(pricingHandoffSource).toContain('<PageHeader');
expect(pricingHandoffSource).not.toContain('<h1');
});
- it('keeps monitored-system pricing handoffs inside the product', async () => {
+ it('keeps monitored-system pricing handoffs inside usage review', async () => {
window.history.replaceState({}, '', '/pricing?feature=max_monitored_systems');
render(() => (
<Router>
<Route path="/pricing" component={PricingHandoff} />
<Route
- path="/settings/system/billing/plan"
+ path="/settings/system/billing/usage"
component={() => <div>Billing destination</div>}
/>
</Router>
diff --git a/frontend-modern/src/stores/__tests__/license.test.ts b/frontend-modern/src/stores/__tests__/license.test.ts
index f46180ccfc..121e8d3194 100644
--- a/frontend-modern/src/stores/__tests__/license.test.ts
+++ b/frontend-modern/src/stores/__tests__/license.test.ts
@@ -426,14 +426,14 @@ describe('license stores', () => {
expect(getUpgradeActionUrlOrFallback('relay')).toBe(getUpgradeFallbackDestination('relay'));
});
- it('routes monitored-system limit fallbacks to the billing upgrade arrival', async () => {
+ it('routes monitored-system limit fallbacks to usage instead of plan purchase', async () => {
vi.mocked(LicenseAPI.getCommercialPosture).mockResolvedValue({
...mockCommercialPosture,
upgrade_reasons: [{ key: 'reason1', reason: 'Reason 1', action_url: '/upgrade/reason1' }],
});
await loadCommercialPosture(true);
expect(getUpgradeActionUrlOrFallback('max_monitored_systems')).toBe(
- '/settings/system/billing/plan?intent=self_hosted_plan',
+ '/settings/system/billing/usage?details=counting-rules',
);
});
@@ -451,7 +451,7 @@ describe('license stores', () => {
);
});
- it('prefers a specific monitored-system upgrade action when provided', async () => {
+ it('keeps specific monitored-system upgrade actions on usage review', async () => {
vi.mocked(LicenseAPI.getCommercialPosture).mockResolvedValue({
...mockCommercialPosture,
upgrade_reasons: [
diff --git a/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts b/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts
index 6ebde40593..628ee2b73d 100644
--- a/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts
@@ -257,9 +257,7 @@ describe('monitoredSystemPresentation', () => {
existing_monitoring_continues: true,
},
),
- ).toBe(
- 'Continuity verification pending. 16 monitored, 5 included.',
- );
+ ).toBe('Continuity verification pending. 16 monitored, 5 included.');
expect(
formatMonitoredSystemLegacyConnectionBreakdown({
proxmox_nodes: 2,
@@ -297,9 +295,10 @@ describe('monitoredSystemPresentation', () => {
{ label: 'Status', value: 'Over policy by 11' },
],
statusMessage: 'Existing monitoring continues. Additional monitored systems are paused.',
- detailMessage: 'Reduce usage or resolve the applicable policy before adding another monitored system.',
+ detailMessage:
+ 'Reduce usage or resolve the applicable policy before adding another monitored system.',
explanation: {
- label: 'Why am I over plan?',
+ label: 'Why is this over policy?',
body: 'This installation was already monitoring 16 monitored systems before Pulse paused net-new monitored-system admissions at the active finite policy boundary. Pulse keeps those existing systems visible, but additional monitored systems stay paused until usage is reduced or the policy changes.',
},
});
diff --git a/frontend-modern/src/utils/__tests__/pricingHandoff.test.ts b/frontend-modern/src/utils/__tests__/pricingHandoff.test.ts
index 67286f40d9..ece4f4bafc 100644
--- a/frontend-modern/src/utils/__tests__/pricingHandoff.test.ts
+++ b/frontend-modern/src/utils/__tests__/pricingHandoff.test.ts
@@ -30,9 +30,9 @@ import {
} from '@/utils/pricingHandoff';
describe('pricingHandoff', () => {
- it('routes product-owned monitored-system pricing links to billing', () => {
+ it('routes legacy monitored-system pricing links to usage, not plan purchase', () => {
expect(getUpgradeFallbackDestination('max_monitored_systems')).toBe(
- SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,
+ SELF_HOSTED_PRO_BILLING_USAGE_COUNTING_RULES_HREF,
);
});
@@ -77,7 +77,7 @@ describe('pricingHandoff', () => {
it('keeps internal route exceptions when handing off the legacy pricing route', () => {
expect(getPricingRouteDestination('?feature=max_monitored_systems')).toBe(
- SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,
+ SELF_HOSTED_PRO_BILLING_USAGE_COUNTING_RULES_HREF,
);
});
@@ -108,11 +108,21 @@ describe('pricingHandoff', () => {
resolveCanonicalSelfHostedBillingHref(SELF_HOSTED_PRO_BILLING_ROUTE, '', '#pulse-pro-usage'),
).toBe(SELF_HOSTED_PRO_BILLING_USAGE_HREF);
expect(
- resolveCanonicalSelfHostedBillingHref(SELF_HOSTED_PRO_BILLING_ROUTE, '', '#pulse-pro-recovery'),
+ resolveCanonicalSelfHostedBillingHref(
+ SELF_HOSTED_PRO_BILLING_ROUTE,
+ '',
+ '#pulse-pro-recovery',
+ ),
).toBe(SELF_HOSTED_PRO_BILLING_PLAN_RECOVERY_HREF);
expect(resolveCanonicalSelfHostedBillingHref(SELF_HOSTED_PRO_BILLING_ROUTE)).toBe(
SELF_HOSTED_PRO_BILLING_PLAN_HREF,
);
+ expect(
+ resolveCanonicalSelfHostedBillingHref(
+ SELF_HOSTED_PRO_BILLING_PLAN_HREF,
+ '?intent=max_monitored_systems',
+ ),
+ ).toBe(SELF_HOSTED_PRO_BILLING_USAGE_COUNTING_RULES_HREF);
});
it('derives billing focus and arrival intent from canonical routes', () => {
@@ -124,12 +134,16 @@ describe('pricingHandoff', () => {
expect(
getSelfHostedBillingPlanIntent('?intent=' + SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT),
).toBe(SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT);
- expect(getSelfHostedBillingPlanIntent('?intent=max_monitored_systems')).toBe(
- SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT,
- );
- expect(getSelfHostedBillingPlanDetail('?details=' + SELF_HOSTED_PRO_BILLING_RECOVERY_DETAIL)).toBe(
- SELF_HOSTED_PRO_BILLING_RECOVERY_DETAIL,
- );
+ expect(
+ resolveSelfHostedBillingSection(
+ SELF_HOSTED_PRO_BILLING_PLAN_HREF,
+ '?intent=max_monitored_systems',
+ ),
+ ).toBe('usage');
+ expect(getSelfHostedBillingPlanIntent('?intent=max_monitored_systems')).toBeNull();
+ expect(
+ getSelfHostedBillingPlanDetail('?details=' + SELF_HOSTED_PRO_BILLING_RECOVERY_DETAIL),
+ ).toBe(SELF_HOSTED_PRO_BILLING_RECOVERY_DETAIL);
expect(
getSelfHostedBillingPurchaseArrival(
'?purchase=' + SELF_HOSTED_PRO_BILLING_PURCHASE_ACTIVATED,
diff --git a/frontend-modern/src/utils/monitoredSystemPresentation.ts b/frontend-modern/src/utils/monitoredSystemPresentation.ts
index 652dd58789..07a7d447aa 100644
--- a/frontend-modern/src/utils/monitoredSystemPresentation.ts
+++ b/frontend-modern/src/utils/monitoredSystemPresentation.ts
@@ -469,7 +469,7 @@ export function getMonitoredSystemLimitContextSummary(
switch (resolved.mode) {
case 'unlimited':
- return 'This plan does not cap monitored systems.';
+ return 'This policy does not cap monitored systems.';
case 'over_limit_frozen':
if (resolved.reason === 'legacy_migration_capture_pending') {
return `This finite policy includes ${resolved.limit}. Pulse is still verifying the migrated v5 continuity floor for this installation. Existing monitoring continues while additional monitored-system admissions pause until continuity capture finishes.`;
@@ -528,13 +528,14 @@ export function buildMonitoredSystemCapacitySectionModel(
case 'unlimited':
return {
stats,
- statusMessage: 'This plan does not cap monitored systems.',
+ statusMessage: 'This policy does not cap monitored systems.',
};
case 'at_limit_blocking_new':
return {
stats,
statusMessage: 'Existing monitoring continues. Additional monitored systems are paused.',
- detailMessage: 'Reduce usage or resolve the applicable policy before adding another monitored system.',
+ detailMessage:
+ 'Reduce usage or resolve the applicable policy before adding another monitored system.',
};
case 'over_limit_frozen':
if (resolved.reason === 'legacy_migration_capture_pending') {
@@ -542,8 +543,7 @@ export function buildMonitoredSystemCapacitySectionModel(
stats,
statusMessage:
'Existing monitoring continues. Additional monitored systems are temporarily paused.',
- detailMessage:
- 'Pulse is still verifying migrated v5 continuity for this installation.',
+ detailMessage: 'Pulse is still verifying migrated v5 continuity for this installation.',
explanation: {
label: 'Why is continuity still pending?',
body: `Pulse is still verifying the grandfathered monitored-system floor for this migrated v5 installation. The finite policy includes ${resolved.limit}, while this installation is already monitoring ${resolved.current}. Existing monitoring continues while additional monitored-system admissions pause until continuity capture finishes.`,
@@ -553,9 +553,10 @@ export function buildMonitoredSystemCapacitySectionModel(
return {
stats,
statusMessage: 'Existing monitoring continues. Additional monitored systems are paused.',
- detailMessage: 'Reduce usage or resolve the applicable policy before adding another monitored system.',
+ detailMessage:
+ 'Reduce usage or resolve the applicable policy before adding another monitored system.',
explanation: {
- label: 'Why am I over plan?',
+ label: 'Why is this over policy?',
body: `This installation was already monitoring ${resolved.current} monitored systems before Pulse paused net-new monitored-system admissions at the active finite policy boundary. Pulse keeps those existing systems visible, but additional monitored systems stay paused until usage is reduced or the policy changes.`,
},
};
diff --git a/frontend-modern/src/utils/pricingHandoff.ts b/frontend-modern/src/utils/pricingHandoff.ts
index 64365c5396..ad736e580c 100644
--- a/frontend-modern/src/utils/pricingHandoff.ts
+++ b/frontend-modern/src/utils/pricingHandoff.ts
@@ -24,7 +24,7 @@ export const SELF_HOSTED_PRO_BILLING_PURCHASE_QUERY_PARAM = 'purchase';
export const SELF_HOSTED_PRO_BILLING_COUNTING_RULES_DETAIL = 'counting-rules';
export const SELF_HOSTED_PRO_BILLING_RECOVERY_DETAIL = 'recovery';
export const SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT = 'self_hosted_plan';
-const LEGACY_SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT = 'max_monitored_systems';
+const LEGACY_MONITORED_SYSTEM_BILLING_INTENT = 'max_monitored_systems';
export const SELF_HOSTED_PRO_BILLING_PURCHASE_ACTIVATED = 'activated';
export const SELF_HOSTED_PRO_BILLING_PURCHASE_CANCELLED = 'cancelled';
export const SELF_HOSTED_PRO_BILLING_PURCHASE_EXPIRED = 'expired';
@@ -51,7 +51,7 @@ export const SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF = `${SELF_HOSTED_PRO_BI
const IN_PRODUCT_PRICING_DESTINATIONS: Record<string, string> = {
self_hosted_plan: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,
- max_monitored_systems: SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,
+ max_monitored_systems: SELF_HOSTED_PRO_BILLING_USAGE_COUNTING_RULES_HREF,
cloud: '/cloud',
// Pro-feature keys: route to billing plan page instead of the Pulse Account
// purchase-start handoff, which fails for local instances without PublicURL.
@@ -89,6 +89,13 @@ function billingSearch(search: string): URLSearchParams {
return new URLSearchParams(normalizeSearch(search));
}
+function hasLegacyMonitoredSystemBillingIntent(search: string): boolean {
+ return (
+ billingSearch(search).get(SELF_HOSTED_PRO_BILLING_PLAN_INTENT_QUERY_PARAM)?.trim() ===
+ LEGACY_MONITORED_SYSTEM_BILLING_INTENT
+ );
+}
+
function isSelfHostedBillingPath(pathname: string): boolean {
const normalized = normalizeSettingsLikePath(pathname);
return (
@@ -174,10 +181,7 @@ export function getSelfHostedBillingPlanDetail(search: string): SelfHostedBillin
export function getSelfHostedBillingPlanIntent(search: string): SelfHostedBillingPlanIntent | null {
const intent = billingSearch(search).get(SELF_HOSTED_PRO_BILLING_PLAN_INTENT_QUERY_PARAM)?.trim();
- if (
- intent === SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT ||
- intent === LEGACY_SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT
- ) {
+ if (intent === SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT) {
return SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_INTENT;
}
return null;
@@ -247,6 +251,9 @@ export function resolveSelfHostedBillingSection(
): SelfHostedBillingSection {
const normalizedPath = normalizeSettingsLikePath(pathname);
+ if (hasLegacyMonitoredSystemBillingIntent(search)) {
+ return 'usage';
+ }
if (normalizedPath === SELF_HOSTED_PRO_BILLING_USAGE_ROUTE) {
return 'usage';
}
@@ -288,9 +295,11 @@ export function resolveCanonicalSelfHostedBillingHref(
const section = resolveSelfHostedBillingSection(normalizedPath, search, hash);
const normalizedHash = normalizeHash(hash);
+ const legacyMonitoredSystemIntent = hasLegacyMonitoredSystemBillingIntent(search);
const usageDetail =
section === 'usage' &&
- getSelfHostedBillingUsageDetail(search) === SELF_HOSTED_PRO_BILLING_COUNTING_RULES_DETAIL
+ (getSelfHostedBillingUsageDetail(search) === SELF_HOSTED_PRO_BILLING_COUNTING_RULES_DETAIL ||
+ legacyMonitoredSystemIntent)
? SELF_HOSTED_PRO_BILLING_COUNTING_RULES_DETAIL
: null;
const planIntent = section === 'plan' ? getSelfHostedBillingPlanIntent(search) : null;
diff --git a/tests/integration/tests/54-monitored-system-billing-focus.spec.ts b/tests/integration/tests/54-monitored-system-billing-focus.spec.ts
index c2d50becb9..674ab17ff6 100644
--- a/tests/integration/tests/54-monitored-system-billing-focus.spec.ts
+++ b/tests/integration/tests/54-monitored-system-billing-focus.spec.ts
@@ -248,17 +248,14 @@ async function configureMonitoredSystemBillingFixtures(
);
}
-async function openPageWithUrgentMonitoredSystemBanner(page: Page) {
+async function openSelfHostedGeneralSettings(page: Page) {
await page.goto(`${DEV_SERVER_URL}/settings/system-general`, {
waitUntil: "domcontentloaded",
});
- await expect(
- page.getByRole("status").filter({ hasText: "Over plan by 11. 16 monitored, 5 included." }),
- ).toBeVisible();
}
test.describe("Monitored-system billing focus", () => {
-test("keeps capacity and upgrade arrivals distinct on the billing surface", async ({
+ test("keeps monitored-system capacity review informational on self-hosted billing", async ({
page,
}, testInfo) => {
test.skip(
@@ -267,27 +264,41 @@ test("keeps capacity and upgrade arrivals distinct on the billing surface", asyn
);
await configureMonitoredSystemBillingFixtures(page);
- await openPageWithUrgentMonitoredSystemBanner(page);
+ await openSelfHostedGeneralSettings(page);
- const banner = page
- .getByRole("status")
- .filter({ hasText: "Over plan by 11. 16 monitored, 5 included." });
+ await expect(
+ page
+ .getByRole("status")
+ .filter({ hasText: "Over policy by 11. 16 monitored, 5 included." }),
+ ).toHaveCount(0);
+ await expect(
+ page.getByRole("link", { name: "Upgrade to add more" }),
+ ).toHaveCount(0);
- await banner.getByRole("link", { name: "View capacity" }).click();
+ await page.goto(`${DEV_SERVER_URL}/settings/system/billing/plan`, {
+ waitUntil: "domcontentloaded",
+ });
await page.waitForURL("**/settings/system/billing/plan");
await expect(page.getByRole("tab", { name: "Plan" })).toHaveAttribute(
"aria-selected",
"true",
);
await expect(
- page
- .getByText("Existing monitoring continues. New monitored systems are blocked."),
+ page.getByText(
+ "Existing monitoring continues. Additional monitored systems are paused.",
+ ),
).toBeVisible();
- await expect(page.getByText("Why am I over plan?")).toBeVisible();
- await expect(page.getByRole("link", { name: "Review monitored systems" })).toHaveAttribute(
- "href",
- "/settings/system/billing/usage",
+ await expect(page.getByText("Why is this over policy?")).toBeVisible();
+ await expect(
+ page.getByRole("link", { name: "Review monitored systems" }),
+ ).toHaveAttribute("href", "/settings/system/billing/usage");
+ await expect(page.getByText("Compare self-hosted plans")).toHaveCount(0);
+ await expect(page.getByRole("link", { name: "Compare plans" })).toHaveCount(
+ 0,
);
+ await expect(
+ page.getByRole("link", { name: "Upgrade to add more" }),
+ ).toHaveCount(0);
await page.getByRole("link", { name: "Review monitored systems" }).click();
await page.waitForURL("**/settings/system/billing/usage");
@@ -295,30 +306,14 @@ test("keeps capacity and upgrade arrivals distinct on the billing surface", asyn
"aria-selected",
"true",
);
- await expect(page.getByRole("button", { name: "View counting rules" })).toBeVisible();
- await expect(page.getByText("Counts as 1 monitored system")).toBeVisible();
- await expect(page.getByText("1 grouped source")).toBeVisible();
-
- await openPageWithUrgentMonitoredSystemBanner(page);
-
- await banner.getByRole("link", { name: "Upgrade to add more" }).click();
- await page.waitForURL(
- "**/settings/system/billing/plan?intent=self_hosted_plan",
- );
- await expect(page.getByRole("tab", { name: "Plan" })).toHaveAttribute(
- "aria-selected",
- "true",
- );
await expect(
- page.getByText("Compare self-hosted plans"),
+ page.getByRole("button", { name: "View counting rules" }),
).toBeVisible();
- await expect(page.getByText("Redeem existing key")).toBeVisible();
- await expect(page.getByLabel("Pulse Pro Key")).toBeHidden();
- await expect(
- page.getByRole("link", { name: "Compare plans" }),
- ).toHaveAttribute(
- "href",
- "/auth/license-purchase-start?feature=self_hosted_plan",
+ await expect(page.getByText("Counts as 1 monitored system")).toBeVisible();
+ await expect(page.getByText("1 grouped source")).toBeVisible();
+ await expect(page.getByText("Compare self-hosted plans")).toHaveCount(0);
+ await expect(page.getByRole("link", { name: "Compare plans" })).toHaveCount(
+ 0,
);
});
@@ -340,7 +335,7 @@ test("keeps capacity and upgrade arrivals distinct on the billing surface", asyn
});
await expect(
- page.getByRole("status").filter({ hasText: "over plan by 11" }),
+ page.getByRole("status").filter({ hasText: "over policy by 11" }),
).toHaveCount(0);
await expect(
page.getByRole("link", { name: "Upgrade to add more" }),