Skip to content
This repository has been archived by the owner. It is now read-only.

Fixes stop promotions for notifications #13055

Merged
merged 1 commit into from Feb 16, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Fixes stop promotions for notifications

Resolves #13021

Auditors:

Test Plan:
  • Loading branch information
NejcZdovc authored and bsclifton committed Feb 7, 2018
commit 8e9869bbe92cca781bbe9af72a51a10fe5677d43
@@ -364,7 +364,8 @@ const showPromotionNotification = (state) => {
(
getSetting(settings.PAYMENTS_ENABLED) &&
!getSetting(settings.PAYMENTS_NOTIFICATIONS)
)
) ||
!getSetting(settings.PAYMENTS_ALLOW_PROMOTIONS)
) {
return
}
@@ -19,6 +19,7 @@ describe('ledgerNotifications unit test', function () {
let paymentsNotifications
let paymentsMinVisitTime = 5000
let paymentsContributionAmount = 25
let paymentsAllowPromotions = true

const defaultAppState = Immutable.fromJS({
ledger: {},
@@ -49,6 +50,8 @@ describe('ledgerNotifications unit test', function () {
return paymentsMinVisitTime
case settings.PAYMENTS_CONTRIBUTION_AMOUNT:
return paymentsContributionAmount
case settings.PAYMENTS_ALLOW_PROMOTIONS:
return paymentsAllowPromotions
}
return false
}
@@ -591,6 +594,13 @@ describe('ledgerNotifications unit test', function () {
assert(showNotificationSpy.calledOnce)
})

it('promotions are disabled, notification is not shown', function () {
paymentsAllowPromotions = false
ledgerNotificationsApi.showPromotionNotification(state)
assert(showNotificationSpy.notCalled)
paymentsAllowPromotions = true
})

it('notification is shown', function () {
ledgerNotificationsApi.showPromotionNotification(state)
assert(showNotificationSpy.calledOnce)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.