package api import ( "os" "strings" "testing" ) // R-536 — the ACCEPT-time path must not claim the app is installed. // // The router holds a concrete *notify.Notifier, so there is no seam to fake here; the claim is // therefore asserted where it actually lives — in the source of the deploy handler. This is the same // shape as the stacks package's AST test, and it exists for the same reason: the defect was not a // wrong value, it was a call in the wrong place. // // What it pins: the deploy handler (which writes 202 „Telepítés elindítva" and returns, while the // compose up runs afterwards) may announce that the install STARTED, and may not announce that it // finished. The finishing half is stacks.deployDoneHook → main.go → NotifyAppDeployed, pinned by // TestDeployDoneHook_FiresAtTheEndAndSaysWhichEndItWas. // // Red-proof: put `r.notifier.NotifyAppDeployed(name, displayName)` back beside the 202 → this fails. func TestDeployAcceptance_DoesNotClaimTheAppIsInstalled(t *testing.T) { src, err := os.ReadFile("router.go") if err != nil { t.Fatal(err) } body := string(src) if strings.Contains(body, "NotifyAppDeployed(") { t.Fatal("the deploy handler announces an INSTALLED app at accept time — the install has not run yet; " + "an interrupted deploy then stands on the timeline as a completed one (measured 2026-09-16, mealie)") } if !strings.Contains(body, "NotifyAppDeployStarted(") { t.Fatal("the acceptance is no longer recorded at all — the timeline loses the fact that the customer asked for this app") } }