fix(campaigns): enable the connection test when it can actually run

Follows the backend split between "can launch" and "can run a connection
test". An account with no payment method still gets the test, because the
test only creates paused objects — and that is the case where confirming
Meta accepts our requests matters most.

The disabled note now names the check that is actually in the way instead
of implying every failed check is.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
AFFAANh
2026-08-07 13:12:32 +05:30
co-authored by Claude Opus 5
parent 096c47dd0c
commit f643539c29
2 changed files with 14 additions and 4 deletions
+9
View File
@@ -179,9 +179,18 @@ export interface SetupCheck {
}
export interface SetupDiagnostics {
/** Every check passed. Only then can a campaign be launched. */
ready: boolean;
/** Names of the failed checks, in the order they ran. */
blocking: string[];
/**
* The connection test can run. Deliberately weaker than `ready`: it
* creates paused objects, so it needs a token, an account and a Page,
* but neither a payment method nor an operator identity.
*/
can_smoke_test: boolean;
/** The subset of `blocking` that stops the connection test. */
smoke_test_blocking: string[];
checks: SetupCheck[];
}
+5 -4
View File
@@ -151,7 +151,7 @@ export default function SetupChecklist({ adAccountId }: Props) {
<Button
onClick={confirmSmokeTest}
loading={smokeRunning}
disabled={loading || !report?.ready}
disabled={loading || !report?.can_smoke_test}
>
Run connection test
</Button>
@@ -216,10 +216,11 @@ export default function SetupChecklist({ adAccountId }: Props) {
)}
/>
{!report.ready && (
{!report.can_smoke_test && (
<Text type="secondary">
The connection test stays disabled until the checks above pass
it would fail for the same reason and tell you nothing new.
The connection test stays disabled until{" "}
{report.smoke_test_blocking.join(", ")} passes it would fail
for the same reason and tell you nothing new.
</Text>
)}
</Space>