Skip to content

Commit

Permalink
Change price format for RSD currency
Browse files Browse the repository at this point in the history
  • Loading branch information
buresmi7 committed Jun 21, 2024
1 parent 3734b9e commit 9fd5b50
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/shared/src/reactComponents/Price.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class Price extends React.Component<Props> {
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
Expand Down
13 changes: 13 additions & 0 deletions cypress/e2e/client/changeLanguage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('[email protected]')
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.')
})
})

0 comments on commit 9fd5b50

Please sign in to comment.