test(oauth): align antigravity gate source test with degraded-only re-auth spread (#20067)

The re-auth update paths now spread antigravityPersistStatus() only when the
project is degraded, so a healthy re-auth cannot wipe the cooldown evidence
buildOAuthTokenUpdate() preserves. Assert that conditional spread at all three
route update sites and in persistOAuthConnection, keeping the create-payload
assertion.
This commit is contained in:
Rafa Martins
2026-11-19 07:13:27 -03:00
committed by diegosouzapw
parent 3274a6d2ec
commit b294213aff

View File

@@ -32,7 +32,17 @@ test("degrade gate is wired into the exchange, poll-callback and import-token br
test("connects are SAVED with degraded status, not rejected", () => {
// No 422 rejection in the antigravity project path: the upsert proceeds and
// the degraded fields flow into both the update and create payloads.
assert.match(routeSource, /\.\.\.antigravityPersistStatus\(degradedProject\)/);
// Re-auth updates spread the degraded markers only when the project is degraded,
// so a healthy re-auth cannot wipe the cooldown evidence that
// buildOAuthTokenUpdate() preserves during an active quota window (#20067).
const degradedOnlySpread =
/\.\.\.\(degradedProject \? antigravityPersistStatus\(degradedProject\) : \{\}\)/;
assert.equal(
(routeSource.match(new RegExp(degradedOnlySpread.source, "g")) || []).length,
3,
"exchange, poll-callback AND import-token updates must carry the degraded markers"
);
assert.match(persistenceSource, degradedOnlySpread);
assert.match(persistenceSource, /\.\.\.antigravityPersistStatus\(degradedProject\)/);
assert.match(routeSource, /warning: degradedProject\.warning/);
// paste-credentials / device-complete used to hardcode testStatus:"active".