diff --git a/test/api/unit/libs/payments/payments.test.js b/test/api/unit/libs/payments/payments.test.js index dbed33741f..82fb3dabad 100644 --- a/test/api/unit/libs/payments/payments.test.js +++ b/test/api/unit/libs/payments/payments.test.js @@ -209,7 +209,7 @@ describe('payments/index', () => { await api.createSubscription(data); let msg = '\`Hello recipient, sender has sent you 3 months of subscription!\`'; - expect(user.sendMessage).to.be.calledTwice; + expect(user.sendMessage).to.be.calledOnce; expect(user.sendMessage).to.be.calledWith(recipient, { receiverMsg: msg, senderMsg: msg, save: false }); }); @@ -247,77 +247,6 @@ describe('payments/index', () => { }, }); }); - - context('Winter 2018-19 Gift-1-Get-1 Promotion', async () => { - it('creates a gift subscription for purchaser and recipient if none exist', async () => { - await api.createSubscription(data); - - expect(user.items.pets['Jackalope-RoyalPurple']).to.eql(5); - expect(user.purchased.plan.customerId).to.eql('Gift'); - expect(user.purchased.plan.dateTerminated).to.exist; - expect(user.purchased.plan.dateUpdated).to.exist; - expect(user.purchased.plan.dateCreated).to.exist; - - expect(recipient.items.pets['Jackalope-RoyalPurple']).to.eql(5); - expect(recipient.purchased.plan.customerId).to.eql('Gift'); - expect(recipient.purchased.plan.dateTerminated).to.exist; - expect(recipient.purchased.plan.dateUpdated).to.exist; - expect(recipient.purchased.plan.dateCreated).to.exist; - }); - - it('adds extraMonths to existing subscription for purchaser and creates a gift subscription for recipient without sub', async () => { - user.purchased.plan = plan; - - expect(user.purchased.plan.extraMonths).to.eql(0); - - await api.createSubscription(data); - - expect(user.purchased.plan.extraMonths).to.eql(3); - - expect(recipient.items.pets['Jackalope-RoyalPurple']).to.eql(5); - expect(recipient.purchased.plan.customerId).to.eql('Gift'); - expect(recipient.purchased.plan.dateTerminated).to.exist; - expect(recipient.purchased.plan.dateUpdated).to.exist; - expect(recipient.purchased.plan.dateCreated).to.exist; - }); - - it('adds extraMonths to existing subscription for recipient and creates a gift subscription for purchaser without sub', async () => { - recipient.purchased.plan = plan; - - expect(recipient.purchased.plan.extraMonths).to.eql(0); - - await api.createSubscription(data); - - expect(recipient.purchased.plan.extraMonths).to.eql(3); - - expect(user.items.pets['Jackalope-RoyalPurple']).to.eql(5); - expect(user.purchased.plan.customerId).to.eql('Gift'); - expect(user.purchased.plan.dateTerminated).to.exist; - expect(user.purchased.plan.dateUpdated).to.exist; - expect(user.purchased.plan.dateCreated).to.exist; - }); - - it('adds extraMonths to existing subscriptions for purchaser and recipient', async () => { - user.purchased.plan = plan; - recipient.purchased.plan = plan; - - expect(user.purchased.plan.extraMonths).to.eql(0); - expect(recipient.purchased.plan.extraMonths).to.eql(0); - - await api.createSubscription(data); - - expect(user.purchased.plan.extraMonths).to.eql(3); - expect(recipient.purchased.plan.extraMonths).to.eql(3); - }); - - it('sends a private message about the promotion', async () => { - await api.createSubscription(data); - let msg = '\`Hello sender, you received 3 months of subscription as part of our holiday gift-giving promotion!\`'; - - expect(user.sendMessage).to.be.calledTwice; - expect(user.sendMessage).to.be.calledWith(user, { senderMsg: msg }); - }); - }); }); context('Purchasing a subscription for self', () => { diff --git a/website/client/app.vue b/website/client/app.vue index e9cc55a68f..bde06ec6dd 100644 --- a/website/client/app.vue +++ b/website/client/app.vue @@ -24,12 +24,6 @@ div span.resume(@click="resumeDamage()") {{ $t('resumeDamage') }} .closepadding(@click="hideBanner()") span.svg-icon.inline.icon-10(aria-hidden="true", v-html="icons.close") - .g1g1-banner.d-flex.justify-content-center.align-items-center(v-if="!giftingHidden") - .svg-icon.svg-gifts.left-gift(v-html="icons.gifts") - router-link(:to="{name: 'subscription'}") {{ $t('g1g1Announcement') }} - .svg-icon.svg-gifts.right-gift(v-html="icons.gifts") - .closepadding(@click="hideGiftingBanner()") - span.svg-icon.inline.icon-10(aria-hidden="true", v-html="icons.close") notifications-display app-menu .container-fluid @@ -97,41 +91,6 @@ div flex: 1 0 auto; } - .g1g1-banner { - width: 100%; - min-height: 2.5rem; - background-color: #34b5c1; - - a { - color: $white; - text-decoration: none; - font-weight: bold; - } - - .closepadding { - margin: 11px 24px; - display: inline-block; - position: relative; - right: 0; - top: 0; - cursor: pointer; - } - - .left-gift { - margin: auto 1rem auto auto; - } - - .right-gift { - margin: auto auto auto 1rem; - filter: FlipH; - transform: scaleX(-1); - } - - .svg-gifts { - width: 4.6rem; - } - } - .notification { border-radius: 1000px; background-color: $green-10; @@ -230,9 +189,8 @@ import amazonPaymentsModal from 'client/components/payments/amazonModal'; import paymentsSuccessModal from 'client/components/payments/successModal'; import spellsMixin from 'client/mixins/spells'; -import { CONSTANTS, getLocalSetting, removeLocalSetting, setLocalSetting } from 'client/libs/userlocalManager'; +import { CONSTANTS, getLocalSetting, removeLocalSetting } from 'client/libs/userlocalManager'; -import gifts from 'assets/svg/gifts.svg'; import svgClose from 'assets/svg/close.svg'; import bannedAccountModal from 'client/components/bannedAccountModal'; @@ -257,7 +215,6 @@ export default { return { icons: Object.freeze({ close: svgClose, - gifts, }), selectedItemToBuy: null, selectedSpellToBuy: null, @@ -268,8 +225,6 @@ export default { loading: true, currentTipNumber: 0, bannerHidden: false, - bannerHeight: 0, - giftingHidden: getLocalSetting(CONSTANTS.keyConstants.GIFTING_BANNER_DISPLAY) === 'dismissed', }; }, computed: { @@ -660,10 +615,6 @@ export default { hideBanner () { this.bannerHidden = true; }, - hideGiftingBanner () { - setLocalSetting(CONSTANTS.keyConstants.GIFTING_BANNER_DISPLAY, 'dismissed'); - this.giftingHidden = true; - }, resumeDamage () { this.$store.dispatch('user:sleep'); }, diff --git a/website/client/components/payments/sendGemsModal.vue b/website/client/components/payments/sendGemsModal.vue index a1f419fd63..4933232f98 100644 --- a/website/client/components/payments/sendGemsModal.vue +++ b/website/client/components/payments/sendGemsModal.vue @@ -38,10 +38,6 @@ b-modal#send-gems(:title="title", :hide-footer="true", size='lg', @hide='onHide( label input(type="radio", name="subRadio", :value="block.key", v-model='gift.subscription.key') | {{ $t('sendGiftSubscription', {price: block.price, months: block.months}) }} - .col-md-8 - h4 {{ $t('winterPromoGiftHeader') }} - p {{ $t('winterPromoGiftDetails1') }} - p {{ $t('winterPromoGiftDetails2') }} textarea.form-control(rows='3', v-model='gift.message', :placeholder="$t('sendGiftMessagePlaceholder')") //include ../formatting-help diff --git a/website/client/components/settings/subscription.vue b/website/client/components/settings/subscription.vue index 2768bf10a7..b76747c523 100644 --- a/website/client/components/settings/subscription.vue +++ b/website/client/components/settings/subscription.vue @@ -90,10 +90,6 @@ li(v-once) {{ $t('giftSubscriptionText2') }} li(v-once) {{ $t('giftSubscriptionText3') }} h4(v-once) {{ $t('giftSubscriptionText4') }} - .col-6 - h2 {{ $t('winterPromoGiftHeader') }} - p {{ $t('winterPromoGiftDetails1') }} - p {{ $t('winterPromoGiftDetails2') }}