Merge pull request #4248 from overleaf/tm-ta-new-subscription-currency-fixes

Fix getCurrencyCode behavior and add fallback in frontend for invalid currencies

GitOrigin-RevId: 5cc40b524148f88c0f110d2cf4bb4d3b69844f1b
This commit is contained in:
Thomas
2021-06-24 02:07:14 +00:00
committed by Copybot
parent a1f66a5252
commit be73463e35
5 changed files with 72 additions and 38 deletions
@@ -161,9 +161,9 @@ describe('SubscriptionController', function () {
describe('plansPage', function () {
beforeEach(function () {
this.req.ip = '1234.3123.3131.333 313.133.445.666 653.5345.5345.534'
return this.GeoIpLookup.promises.getCurrencyCode.resolves(
this.stubbedCurrencyCode
)
return this.GeoIpLookup.promises.getCurrencyCode.resolves({
currencyCode: this.stubbedCurrencyCode,
})
})
})
@@ -174,7 +174,7 @@ describe('SubscriptionController', function () {
.stub()
.resolves(true)
return this.GeoIpLookup.promises.getCurrencyCode.resolves({
recomendedCurrency: this.stubbedCurrencyCode,
currencyCode: this.stubbedCurrencyCode,
})
})