fix: remove duplicate saved choice block

This commit is contained in:
Codex 2026-04-16 18:18:45 +03:00
parent 5142ff30db
commit a867bf5464
2 changed files with 5 additions and 11 deletions

View File

@ -67,11 +67,11 @@ export const DeliveryChoiceFlow = ({
const selectionCard = ( const selectionCard = (
<div className="space-y-3 rounded-[22px] border border-[var(--color-border)] bg-[var(--color-surface-strong)] p-4"> <div className="space-y-3 rounded-[22px] border border-[var(--color-border)] bg-[var(--color-surface-strong)] p-4">
<p className="text-sm uppercase tracking-[0.18em] text-[var(--color-text-muted)]"> <p className="text-sm uppercase tracking-[0.18em] text-[var(--color-text-muted)]">
{isChoiceSaved ? "Сохранённый выбор" : "Выбранный слот"} Выбранный слот
</p> </p>
{slotSummary ? ( {slotSummary && !isChoiceSaved ? (
<p className="text-sm leading-6"> <p className="text-sm leading-6">
<span className="font-medium">{isChoiceSaved ? "Сохранено:" : "Выбрано:"}</span> {slotSummary} <span className="font-medium">Выбрано:</span> {slotSummary}
</p> </p>
) : ( ) : (
<p className="text-sm leading-6 text-[var(--color-text-muted)]"> <p className="text-sm leading-6 text-[var(--color-text-muted)]">
@ -84,7 +84,6 @@ export const DeliveryChoiceFlow = ({
if (!isActive) { if (!isActive) {
return ( return (
<div className="space-y-4"> <div className="space-y-4">
{slotSummary ? selectionCard : null}
<DeliveryStateNotice state={state} /> <DeliveryStateNotice state={state} />
</div> </div>
); );

View File

@ -54,19 +54,14 @@ describe("DeliveryChoiceFlow", () => {
orderNumber: "CD-240031", orderNumber: "CD-240031",
customerName: "Мария Волкова", customerName: "Мария Волкова",
}} }}
selectedSlot={{
date: "2026-04-14",
time: "До обеда",
}}
isChoiceSaved isChoiceSaved
onConfirmChoice={() => {}} onConfirmChoice={() => {}}
onRequestNewLink={() => {}} onRequestNewLink={() => {}}
/>, />,
); );
expect(markup).toContain("Сохранённый выбор"); expect(markup).toContain("Доставка уже согласована");
expect(markup).toContain("14.04.2026"); expect(markup).not.toContain("Выбранный слот");
expect(markup).toContain("До обеда");
expect(markup).not.toContain("Сохранить"); expect(markup).not.toContain("Сохранить");
}); });