• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kiva / ui / 4380401906

pending completion
4380401906

Pull #4680

github

GitHub
Merge 390d27320 into 898354c4d
Pull Request #4680: Add to basket cookie error vue 1583

803 of 2093 branches covered (38.37%)

Branch coverage included in aggregate %.

15 of 15 new or added lines in 2 files covered. (100.0%)

1087 of 2812 relevant lines covered (38.66%)

5.16 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/plugins/retry-after-expired-basket-mixin.js
1
import { setLendAmount } from '@/util/basketUtils';
2
import checkInjections from '@/util/injectionCheck';
3
import addToBasketInsterstitial from '@/plugins/add-to-basket-show-interstitial';
4

5
const injections = ['apollo', 'cookieStore'];
×
6

7
export default {
8
        mixins: [addToBasketInsterstitial],
9
        created() {
10
                checkInjections(this, injections);
×
11

12
                // Handle expired basket cookie after refresh
13
                const failedLoan = this.cookieStore.get('kvatbid');
×
14
                if (failedLoan) {
×
15
                        this.$kvTrackEvent('Lending', 'Add to basket', 'Retry after basket cookie refresh');
×
16
                        const loan = JSON.parse(failedLoan);
×
17
                        setLendAmount({
×
18
                                apollo: this.apollo,
19
                                amount: loan.price,
20
                                loanId: loan.id,
21
                        }).then(() => {
22
                                this.triggerAddToBasketInterstitial(loan.id);
×
23
                                this.$emit('add-to-basket', { loanId: loan.id, success: true });
×
24
                        }).catch(e => {
25
                                const msg = e[0]?.extensions?.code === 'reached_anonymous_basket_limit'
×
26
                                        ? e[0]?.message
27
                                        : 'There was a problem adding the loan to your basket';
28

29
                                this.$showTipMsg(msg, 'error');
×
30
                        });
31
                        this.cookieStore.remove('kvatbid');
×
32
                }
33
        }
34
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc