Skip to content

Commit

Permalink
Code changes to avoid rewrite many unit tests for sake of temporary w…
Browse files Browse the repository at this point in the history
…orkaround
  • Loading branch information
kidinov committed Jan 16, 2024
1 parent a6a72c0 commit e9f1ee5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ data class Order(
paymentUrl = "",
isEditable = true,
selectedGiftCard = "",
giftCardDiscountedAmount = BigDecimal(0)
giftCardDiscountedAmount = null
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,20 @@ class OrderCreateEditViewModel @Inject constructor(
}.asLiveData()

val totalsData: LiveData<TotalsSectionsState> =
viewStateData.liveData.combineWith(orderDraft) { viewState, order ->
viewStateData.liveData.combineWith(
_orderDraft.asLiveData(),
_selectedGiftCard.asLiveData()
) { viewState, order, selectedGiftCard ->
totalsHelper.mapToPaymentTotalsState(
order = order!!,
order = order!!.copy(
selectedGiftCard = selectedGiftCard,
giftCardDiscountedAmount = args.giftCardAmount
),
mode = mode,
viewState = viewState!!,
onShippingClicked = { onShippingButtonClicked() },
onCouponsClicked = { onCouponButtonClicked() },
onGiftClicked = { onEditGiftCardButtonClicked(order.selectedGiftCard) },
onGiftClicked = { onEditGiftCardButtonClicked(selectedGiftCard) },
onTaxesLearnMore = { onTaxHelpButtonClicked() },
onMainButtonClicked = { onTotalsSectionPrimaryButtonClicked() },
onExpandCollapseClicked = { onExpandCollapseTotalsClicked(it) }
Expand Down

0 comments on commit e9f1ee5

Please sign in to comment.