updated the test
This commit is contained in:
@@ -157,7 +157,7 @@ export const deriveDeliveryStatus = (bookingOrStatus, consignmentMapOrReachedAt)
|
||||
return isReached ? 'arrived' : 'accepted';
|
||||
}
|
||||
|
||||
return BOOKING_STATUS_TO_DELIVERY_STATUS[rawBookingStatus] || rawBookingStatus;
|
||||
return BOOKING_STATUS_TO_DELIVERY_STATUS[rawBookingStatus] || (rawBookingStatus ? rawBookingStatus : 'pending');
|
||||
};
|
||||
|
||||
export const mapBookingStatusToDeliveryStatus = (statusOrRow, maybeReachedAt) => {
|
||||
|
||||
@@ -18,18 +18,21 @@ const DECIMAL = new Intl.NumberFormat('en-IN');
|
||||
|
||||
/** Money, or a dash. `0` is a real amount and renders as ₹0.00. */
|
||||
export const currency = (value, fallback = '—') => {
|
||||
if (value === null || value === undefined || value === '') return fallback;
|
||||
const n = Number(value);
|
||||
return Number.isFinite(n) ? INR.format(n) : fallback;
|
||||
};
|
||||
|
||||
/** A count with thousands separators, or a dash. */
|
||||
export const number = (value, fallback = '—') => {
|
||||
if (value === null || value === undefined || value === '') return fallback;
|
||||
const n = Number(value);
|
||||
return Number.isFinite(n) ? DECIMAL.format(n) : fallback;
|
||||
};
|
||||
|
||||
/** A distance in km to one decimal, or a dash. */
|
||||
export const km = (value, fallback = '—') => {
|
||||
if (value === null || value === undefined || value === '') return fallback;
|
||||
const n = Number(value);
|
||||
return Number.isFinite(n) ? `${n.toFixed(1)} km` : fallback;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user