fix: remove duplicate saved choice block
This commit is contained in:
parent
5142ff30db
commit
a867bf5464
|
|
@ -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>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -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("Сохранить");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue