mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Align catalog publish option with dialog footer
This commit is contained in:
@@ -35,6 +35,23 @@ export function AgentDefinitionDialogFooter({
|
||||
{submitBlockReason}
|
||||
</p>
|
||||
) : null}
|
||||
{showPublishUpdates ? (
|
||||
<label
|
||||
className="flex cursor-pointer items-center gap-2 text-sm font-medium text-foreground"
|
||||
htmlFor="persona-dialog-publish-updates"
|
||||
>
|
||||
<Checkbox
|
||||
checked={publishUpdatesChecked}
|
||||
data-testid="persona-dialog-publish-updates"
|
||||
disabled={isPending || isAvatarUploadPending}
|
||||
id="persona-dialog-publish-updates"
|
||||
onCheckedChange={(checked) =>
|
||||
onPublishUpdatesCheckedChange(checked === true)
|
||||
}
|
||||
/>
|
||||
<span>Publish updates</span>
|
||||
</label>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
@@ -58,23 +75,6 @@ export function AgentDefinitionDialogFooter({
|
||||
? "Uploading..."
|
||||
: submitLabel}
|
||||
</Button>
|
||||
{showPublishUpdates ? (
|
||||
<label
|
||||
className="ml-1 flex cursor-pointer items-center gap-2 text-sm font-medium text-foreground"
|
||||
htmlFor="persona-dialog-publish-updates"
|
||||
>
|
||||
<Checkbox
|
||||
checked={publishUpdatesChecked}
|
||||
data-testid="persona-dialog-publish-updates"
|
||||
disabled={isPending || isAvatarUploadPending}
|
||||
id="persona-dialog-publish-updates"
|
||||
onCheckedChange={(checked) =>
|
||||
onPublishUpdatesCheckedChange(checked === true)
|
||||
}
|
||||
/>
|
||||
<span>Publish updates</span>
|
||||
</label>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1388,13 +1388,14 @@ This deliberately long fenced-code example must not establish the minimum width
|
||||
"data-state",
|
||||
"unchecked",
|
||||
);
|
||||
const [saveButtonBox, publishUpdatesCheckboxBox] = await Promise.all([
|
||||
editDialog.getByRole("button", { name: "Save changes" }).boundingBox(),
|
||||
const [cancelButtonBox, publishUpdatesCheckboxBox] = await Promise.all([
|
||||
editDialog.getByRole("button", { name: "Cancel" }).boundingBox(),
|
||||
publishUpdatesCheckbox.boundingBox(),
|
||||
]);
|
||||
expect(publishUpdatesCheckboxBox?.x ?? 0).toBeGreaterThan(
|
||||
(saveButtonBox?.x ?? 0) + (saveButtonBox?.width ?? 0),
|
||||
);
|
||||
expect(
|
||||
(publishUpdatesCheckboxBox?.x ?? 0) +
|
||||
(publishUpdatesCheckboxBox?.width ?? 0),
|
||||
).toBeLessThan(cancelButtonBox?.x ?? 0);
|
||||
await editDialog.getByRole("button", { name: "Save changes" }).click();
|
||||
await expect(editDialog).toHaveCount(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user