mirror of
https://github.com/block/buzz.git
synced 2026-10-27 12:40:30 +00:00
Add back action to community profile onboarding (#2136)
Signed-off-by: npub19x6jnl6rhepymwyl2xlltz3ce7rfg2ktllle3g2vu59n3s490k8s9n40l3 <29b529ff43be424db89f51bff58a38cf86942acbffff98a14ce50b38c2a57d8f@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub19x6jnl6rhepymwyl2xlltz3ce7rfg2ktllle3g2vu59n3s490k8s9n40l3 <29b529ff43be424db89f51bff58a38cf86942acbffff98a14ce50b38c2a57d8f@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
@@ -496,7 +496,7 @@ export function CommunityOnboardingFlow({
|
||||
)}
|
||||
>
|
||||
<Button
|
||||
className={ONBOARDING_PRIMARY_CTA_CLASS}
|
||||
className={`${ONBOARDING_PRIMARY_CTA_CLASS} w-20`}
|
||||
data-testid="community-profile-next"
|
||||
disabled={
|
||||
!displayName.trim() || isPending || isUploadingAvatar
|
||||
@@ -506,6 +506,16 @@ export function CommunityOnboardingFlow({
|
||||
>
|
||||
Next
|
||||
</Button>
|
||||
<Button
|
||||
className="h-9 w-20 rounded-full bg-foreground/10 px-6 hover:bg-foreground/15"
|
||||
data-testid="community-profile-back"
|
||||
disabled={isPending || isUploadingAvatar}
|
||||
onClick={onCancel}
|
||||
type="button"
|
||||
variant="ghost"
|
||||
>
|
||||
Back
|
||||
</Button>
|
||||
</OnboardingFooter>
|
||||
<Dialog
|
||||
onOpenChange={(open) => setIsAvatarEditorOpen(open)}
|
||||
|
||||
@@ -1296,7 +1296,7 @@ test("canceling a join to an existing inactive community preserves it", async ({
|
||||
.toEqual(["active-community", "existing-community"]);
|
||||
});
|
||||
|
||||
test("connected first-community profile step cannot discard resumable onboarding", async ({
|
||||
test("connected first-community profile step offers equal-width Next and Back controls", async ({
|
||||
page,
|
||||
}) => {
|
||||
await seedActiveIdentity(page, BLANK_TYLER_IDENTITY);
|
||||
@@ -1551,9 +1551,26 @@ test("connected first-community profile step cannot discard resumable onboarding
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(avatarDialog).toHaveCount(0);
|
||||
await expect(avatarButton).toBeFocused();
|
||||
await expect(page.getByTestId("community-profile-next")).toHaveText("Next");
|
||||
await expect(page.getByTestId("community-profile-next")).toBeDisabled();
|
||||
await expect(page.getByTestId("community-profile-back")).toHaveCount(0);
|
||||
const nextButton = page.getByTestId("community-profile-next");
|
||||
const backButton = page.getByTestId("community-profile-back");
|
||||
await expect(nextButton).toHaveText("Next");
|
||||
await expect(nextButton).toBeDisabled();
|
||||
await expect(backButton).toHaveText("Back");
|
||||
await expect(backButton).toBeEnabled();
|
||||
const [nextBox, backBox] = await Promise.all([
|
||||
nextButton.boundingBox(),
|
||||
backButton.boundingBox(),
|
||||
]);
|
||||
if (!nextBox || !backBox) {
|
||||
throw new Error("Could not measure community profile navigation controls");
|
||||
}
|
||||
expect(Math.abs(nextBox.width - backBox.width)).toBeLessThanOrEqual(1);
|
||||
expect(nextBox.width).toBeLessThanOrEqual(160);
|
||||
|
||||
await backButton.click();
|
||||
await expect(
|
||||
page.getByRole("heading", { name: "Request access to community" }),
|
||||
).toBeVisible();
|
||||
await expect
|
||||
.poll(() =>
|
||||
page.evaluate(
|
||||
@@ -1561,7 +1578,7 @@ test("connected first-community profile step cannot discard resumable onboarding
|
||||
COMMUNITY_ONBOARDING_TRANSACTION_STORAGE_KEY,
|
||||
),
|
||||
)
|
||||
.not.toBeNull();
|
||||
.toBeNull();
|
||||
});
|
||||
|
||||
test("membership denial on community profile save offers recovery", async ({
|
||||
|
||||
Reference in New Issue
Block a user