fix(web): make ShopOfferView.effectSummary/requirements required
The server always sends both fields; an optional frontend type only dodged a transient gap in merchant.store.spec.ts's shopView() fixture and risked a requirement line silently failing to render if a future fixture omitted the fields. Add the two fields to that single fixture instead (an open offer, so null/[] are the honest values) and drop the now-unnecessary `?? []` tolerance in the template.
This commit is contained in:
@@ -446,13 +446,8 @@ export interface ShopOfferView {
|
|||||||
currencyType: string;
|
currencyType: string;
|
||||||
price: number;
|
price: number;
|
||||||
quantity: number;
|
quantity: number;
|
||||||
/**
|
effectSummary: string | null;
|
||||||
* Optional so fixtures written before slice 0.8.5 (e.g. the trade-in store's
|
requirements: ShopOfferRequirement[];
|
||||||
* own spec, out of this task's scope) keep compiling untouched. The server
|
|
||||||
* always sends both fields; the template treats a missing one as "none".
|
|
||||||
*/
|
|
||||||
effectSummary?: string | null;
|
|
||||||
requirements?: ShopOfferRequirement[];
|
|
||||||
unlocked: boolean;
|
unlocked: boolean;
|
||||||
affordable: boolean;
|
affordable: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,7 +228,7 @@
|
|||||||
}}</span>
|
}}</span>
|
||||||
}
|
}
|
||||||
@for (
|
@for (
|
||||||
requirement of offer.requirements ?? [];
|
requirement of offer.requirements;
|
||||||
track requirement.label
|
track requirement.label
|
||||||
) {
|
) {
|
||||||
<span
|
<span
|
||||||
|
|||||||
@@ -89,6 +89,8 @@ function shopView(): ShopView {
|
|||||||
currencyType: 'SILVER',
|
currencyType: 'SILVER',
|
||||||
price: 12,
|
price: 12,
|
||||||
quantity: 1,
|
quantity: 1,
|
||||||
|
effectSummary: null,
|
||||||
|
requirements: [],
|
||||||
unlocked: true,
|
unlocked: true,
|
||||||
affordable: true,
|
affordable: true,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user