Hide quota-blocked hosted Create and simplify native command checks

Signed-off-by: Codex <noreply@openai.com>
This commit is contained in:
Codex
2026-09-29 23:02:47 +00:00
parent 4a90914a8f
commit 0736b704d6
3 changed files with 49 additions and 29 deletions

View File

@@ -814,11 +814,10 @@ mod tests {
"acknowledgement_version": 1,
})
);
for path in ["/v1/buzz/communities/delete"] {
let url = api_url(path).expect("deletion URL");
assert_eq!(url.origin().ascii_serialization(), BUILDERLAB_ORIGIN);
assert_eq!(url.path(), format!("/api/goose{path}"));
}
let path = "/v1/buzz/communities/delete";
let url = api_url(path).expect("deletion URL");
assert_eq!(url.origin().ascii_serialization(), BUILDERLAB_ORIGIN);
assert_eq!(url.path(), format!("/api/goose{path}"));
}
#[test]
@@ -836,13 +835,12 @@ mod tests {
#[test]
fn community_deletion_commands_are_registered_on_the_native_boundary() {
let lib = include_str!("lib.rs");
for command in ["delete_builderlab_community,"] {
assert_eq!(
lib.matches(command).count(),
1,
"{command} must be registered exactly once"
);
}
let command = "delete_builderlab_community,";
assert_eq!(
lib.matches(command).count(),
1,
"{command} must be registered exactly once"
);
assert!(!lib.contains("get_builderlab_community_deletion_receipt"));
let source = include_str!("builderlab.rs");
assert!(source.contains(".header(reqwest::header::ORIGIN, BUILDERLAB_ORIGIN)"));

View File

@@ -1106,23 +1106,24 @@ export function HostedCommunitiesSettingsCard() {
That address is available.
</p>
) : null}
<Button
disabled={
!usableBoundIdentity ||
identityMismatch ||
!validName ||
availability === false ||
checkingName ||
busy ||
atCommunityLimit
}
type="submit"
>
{action ? (
<LoaderCircle className="h-4 w-4 animate-spin" />
) : null}
{action ?? "Create and connect"}
</Button>
{!atCommunityLimit ? (
<Button
disabled={
!usableBoundIdentity ||
identityMismatch ||
!validName ||
availability === false ||
checkingName ||
busy
}
type="submit"
>
{action ? (
<LoaderCircle className="h-4 w-4 animate-spin" />
) : null}
{action ?? "Create and connect"}
</Button>
) : null}
</form>
</>
)}

View File

@@ -193,6 +193,27 @@ test("deletion is default-off and identity mismatch preserves the gate", async (
).toHaveCount(0);
});
test("explicit quota false hides Create and shows the limit copy", async ({
page,
}) => {
await openDeletionFixture(page);
await page.evaluate(() => {
if (window.__BUZZ_E2E__?.mock)
window.__BUZZ_E2E__.mock.builderlabQuota = {
used: 5,
limit: 5,
canCreate: false,
};
});
await page.getByRole("button", { name: "Refresh" }).click();
await expect(
page.getByText(/reached the limit of 5 hosted communities/),
).toBeVisible();
await expect(
page.getByRole("button", { name: "Create and connect" }),
).toHaveCount(0);
});
test("archived deletion requires exact host and two confirmations, then removes the row", async ({
page,
}) => {