From 18a07530cf3e70566a86433596a72399dc3f76da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Bure=C5=A1?= Date: Thu, 18 Jan 2024 15:22:11 +0100 Subject: [PATCH] Change serbian currency format loading from gol --- app/client/src/utils/createAppConfigFromFe.ts | 2 ++ app/shared/src/translation/srTranslation.ts | 2 +- cypress/e2e/client/changeLanguage.js | 4 ++-- tests-utils/httpPages/index.html | 7 +++---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/client/src/utils/createAppConfigFromFe.ts b/app/client/src/utils/createAppConfigFromFe.ts index 7e28239..f96f985 100644 --- a/app/client/src/utils/createAppConfigFromFe.ts +++ b/app/client/src/utils/createAppConfigFromFe.ts @@ -17,6 +17,8 @@ export const createAppConfigFromFe = (doc: Document, url: string): AppConfig | u .item(0) ?.textContent?.trim() .replace('Kč', 'CZK') + .replace(',00', '') // for SR language is different format of price e.g. 7.125,00 + .replace('.', ' ') if (!lowestPrice) { console.log('Flight watchdog error', 'Price not found.') diff --git a/app/shared/src/translation/srTranslation.ts b/app/shared/src/translation/srTranslation.ts index 86c9faf..84dd7d8 100644 --- a/app/shared/src/translation/srTranslation.ts +++ b/app/shared/src/translation/srTranslation.ts @@ -22,7 +22,7 @@ export const srTranslation: TranslationKeys = { ClientMessageMinimalizedWindow: `Tražite jeftiniji let? Kliknite ovde.`, ClientInputEmailPlaceholder: `unesite Vašu e-poštu.`, ClientTitle: `Pratite cenu {?}?`, - ClientDestinationsReturn: `od{_}{?} do{_}{?} i {_}nazad`, + ClientDestinationsReturn: `od{_}{?} do{_}{?} i{_}nazad`, ClientDestinationsOneway: `od{_}{?} do{_}{?}`, ClientDescription: `Pratićemo to za Vas! I svaki dan ćete dobijati novosti. `, ClientDatesReturn: `{?} do {?}`, diff --git a/cypress/e2e/client/changeLanguage.js b/cypress/e2e/client/changeLanguage.js index 36046ac..3e29e28 100644 --- a/cypress/e2e/client/changeLanguage.js +++ b/cypress/e2e/client/changeLanguage.js @@ -57,8 +57,8 @@ describe('Change language', function () { it('sr', function () { cy.visit(golUrlReturn) - setOptions({ lang: 'sr' }) - cy.contains('Pratite cenu 2.000,00 CZK?') + setOptions({ lang: 'sr', price: '7.125,00 RSD' }) + cy.contains('Pratite cenu 7.125,00 RSD?') cy.contains('Prague') cy.contains('London') cy.get('.content input').type('michal@email.cz') diff --git a/tests-utils/httpPages/index.html b/tests-utils/httpPages/index.html index e09ebaf..dc1d467 100644 --- a/tests-utils/httpPages/index.html +++ b/tests-utils/httpPages/index.html @@ -13,8 +13,7 @@ document.getElementsByClassName('header-menu-languages-selected')[0].textContent = document.getElementById('option-lang').value.toUpperCase() document.getElementsByClassName('flight-prices-links-price')[0] .getElementsByTagName('strong')[0] - .getElementsByTagName('span')[0] - .getElementsByTagName('span')[0] = document.getElementById('option-price').value + .getElementsByTagName('span')[0].textContent = document.getElementById('option-price').value var settings = { token: document.getElementById('option-token').value, @@ -36,7 +35,7 @@

Testing page

@@ -59,7 +58,7 @@

Testing page


apiUrl:
- price:
+ price:
defaultPrice (not work yet!):
language:
token: