From 9fd5b50e72fb20624cb738fcc37ebea85f22ed16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Bure=C5=A1?= Date: Fri, 21 Jun 2024 12:07:27 +0200 Subject: [PATCH] Change price format for RSD currency --- app/shared/src/reactComponents/Price.tsx | 2 +- cypress/e2e/client/changeLanguage.js | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/shared/src/reactComponents/Price.tsx b/app/shared/src/reactComponents/Price.tsx index 4ca192c..2e012d0 100644 --- a/app/shared/src/reactComponents/Price.tsx +++ b/app/shared/src/reactComponents/Price.tsx @@ -13,7 +13,7 @@ export class Price extends React.Component { if (this.props.lang === SupportedLanguageEnum.cs) { return priceToShow.replace('CZK', 'Kč') } - if (this.props.lang === SupportedLanguageEnum.sr) { + if (this.props.lang === SupportedLanguageEnum.sr || this.props.price.currency === 'RSD') { return this.props.price.formatToLocale('#.##0,00 ¤') } return priceToShow diff --git a/cypress/e2e/client/changeLanguage.js b/cypress/e2e/client/changeLanguage.js index 7e828ec..ccb96a9 100644 --- a/cypress/e2e/client/changeLanguage.js +++ b/cypress/e2e/client/changeLanguage.js @@ -67,4 +67,17 @@ describe('Change language', function () { cy.get('.content button').click() cy.contains('Tražite jeftiniji let? Kliknite ovde.') }) + + it('en but RSD currency, should shows price format as for sr lang', function () { + cy.visit(golUrlReturn) + setOptions({ lang: 'en', price: '7.125,00 RSD' }) + cy.contains('Track the price 7.125,00 RSD?') + cy.contains('Prague') + cy.contains('London') + cy.get('.content input').type('michal@email.cz') + cy.get(createButtonSelector).click() + cy.contains('Done. When we find a lower price, we will send you an email.') + cy.get('.content button').click() + cy.contains('Looking for a cheaper flight? Click here.') + }) })