From 90303f2f8ceaa3d36cd211a96f511acf0cf5085e Mon Sep 17 00:00:00 2001 From: June Kelly Date: Wed, 13 Apr 2022 10:06:18 +0100 Subject: [PATCH] Merge pull request #7367 from overleaf/tm-add-singapore-currency-mapping Add Singapore/Singapore Dollar to currency mappings GitOrigin-RevId: 1ba2cf35435a8a7ce31ac92c9dd0d92a2cf2e4bf --- services/web/app/src/infrastructure/GeoIpLookup.js | 1 + services/web/test/unit/src/infrastructure/GeoIpLookupTest.js | 1 + 2 files changed, 2 insertions(+) diff --git a/services/web/app/src/infrastructure/GeoIpLookup.js b/services/web/app/src/infrastructure/GeoIpLookup.js index 27e7874055..07b90308a7 100644 --- a/services/web/app/src/infrastructure/GeoIpLookup.js +++ b/services/web/app/src/infrastructure/GeoIpLookup.js @@ -15,6 +15,7 @@ const currencyMappings = { NO: 'NOK', CA: 'CAD', SE: 'SEK', + SG: 'SGD', } const validCurrencyParams = Object.values(currencyMappings).concat(['EUR']) diff --git a/services/web/test/unit/src/infrastructure/GeoIpLookupTest.js b/services/web/test/unit/src/infrastructure/GeoIpLookupTest.js index 8fafd64b4b..b67e24fe71 100644 --- a/services/web/test/unit/src/infrastructure/GeoIpLookupTest.js +++ b/services/web/test/unit/src/infrastructure/GeoIpLookupTest.js @@ -47,6 +47,7 @@ describe('GeoIpLookup', function () { expect(this.GeoIpLookup.isValidCurrencyParam('USD')).to.equal(true) expect(this.GeoIpLookup.isValidCurrencyParam('AUD')).to.equal(true) expect(this.GeoIpLookup.isValidCurrencyParam('EUR')).to.equal(true) + expect(this.GeoIpLookup.isValidCurrencyParam('SGD')).to.equal(true) expect(this.GeoIpLookup.isValidCurrencyParam('WAT')).to.equal(false) expect(this.GeoIpLookup.isValidCurrencyParam('NON')).to.equal(false) expect(this.GeoIpLookup.isValidCurrencyParam('LOL')).to.equal(false)