From 6ba8d15ef5f65e158d282efee1c8467c2ee4334d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 08:30:28 +0000 Subject: [PATCH 1/3] Update dependency vue-i18n to v10 --- package.json | 2 +- yarn.lock | 42 +++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 6a6103b05..eeb1adb52 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "swiper": "^11.0.0", "toml": "^3.0.0", "vue": "^3.0.0", - "vue-i18n": "^9.2.2", + "vue-i18n": "^10.0.0", "vue-router": "^4.0.0", "vuejs3-logger": "^1.0.0" }, diff --git a/yarn.lock b/yarn.lock index 74e9b5a3e..8ffa5b654 100644 --- a/yarn.lock +++ b/yarn.lock @@ -486,26 +486,26 @@ resolved "https://registry.yarnpkg.com/@iarna/toml/-/toml-2.2.5.tgz#b32366c89b43c6f8cefbdefac778b9c828e3ba8c" integrity sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg== -"@intlify/core-base@9.14.0": - version "9.14.0" - resolved "https://registry.yarnpkg.com/@intlify/core-base/-/core-base-9.14.0.tgz#63ce687a6560c0af6a16cb567d9d8a1ea1a5a65e" - integrity sha512-zJn0imh9HIsZZUtt9v8T16PeVstPv6bP2YzlrYJwoF8F30gs4brZBwW2KK6EI5WYKFi3NeqX6+UU4gniz5TkGg== +"@intlify/core-base@10.0.1": + version "10.0.1" + resolved "https://registry.yarnpkg.com/@intlify/core-base/-/core-base-10.0.1.tgz#18ecddcd4ad2f67c0dccb7b72e60036b7b4434d0" + integrity sha512-6kpRGjhos95ph7QmEtP4tnWFTW102s71CLQAQwfsIGqOAcoJhzcYFpzIQ0gKXzqAIXsMD/hwM5qJ4ewqMHw3gg== dependencies: - "@intlify/message-compiler" "9.14.0" - "@intlify/shared" "9.14.0" + "@intlify/message-compiler" "10.0.1" + "@intlify/shared" "10.0.1" -"@intlify/message-compiler@9.14.0": - version "9.14.0" - resolved "https://registry.yarnpkg.com/@intlify/message-compiler/-/message-compiler-9.14.0.tgz#e767141dd12862b3c1bf02ab5fc4852792812381" - integrity sha512-sXNsoMI0YsipSXW8SR75drmVK56tnJHoYbPXUv2Cf9lz6FzvwsosFm6JtC1oQZI/kU+n7qx0qRrEWkeYFTgETA== +"@intlify/message-compiler@10.0.1": + version "10.0.1" + resolved "https://registry.yarnpkg.com/@intlify/message-compiler/-/message-compiler-10.0.1.tgz#2cd25944ffece4312e4dbdd2ebf9556176aaed90" + integrity sha512-fPeykrcgVT5eOIlshTHiPCN8FV3AZyBOdMS3XaXzfQ6eL5wqfc29I/EdIv5YXVW5X8e/BgYeWjBC0Cuznsl/2g== dependencies: - "@intlify/shared" "9.14.0" + "@intlify/shared" "10.0.1" source-map-js "^1.0.2" -"@intlify/shared@9.14.0": - version "9.14.0" - resolved "https://registry.yarnpkg.com/@intlify/shared/-/shared-9.14.0.tgz#e8fb3693ad4171442cbe6cb8922a9b5a22ffb4ef" - integrity sha512-r+N8KRQL7LgN1TMTs1A2svfuAU0J94Wu9wWdJVJqYsoMMLIeJxrPjazihfHpmJqfgZq0ah3Y9Q4pgWV2O90Fyg== +"@intlify/shared@10.0.1": + version "10.0.1" + resolved "https://registry.yarnpkg.com/@intlify/shared/-/shared-10.0.1.tgz#427586698d07a8658560afff1fe55c6d134207b9" + integrity sha512-b4h7IWdZl710DnAhET8lgfgZ4Y9A2IZx/gbli3Ec/zHtYCoPqLHmiM7kUNBrSZj7d/SSjcMMZHuz5I09x3PYZw== "@istanbuljs/load-nyc-config@^1.0.0", "@istanbuljs/load-nyc-config@^1.1.0": version "1.1.0" @@ -6124,13 +6124,13 @@ vue-eslint-parser@^9.4.3: lodash "^4.17.21" semver "^7.3.6" -vue-i18n@^9.2.2: - version "9.14.0" - resolved "https://registry.yarnpkg.com/vue-i18n/-/vue-i18n-9.14.0.tgz#d6f1b3d95bfc4f40e630ff9456c78ab5becfd933" - integrity sha512-LxmpRuCt2rI8gqU+kxeflRZMQn4D5+4M3oP3PWZdowW/ePJraHqhF7p4CuaME52mUxdw3Mmy2yAUKgfZYgCRjA== +vue-i18n@^10.0.0: + version "10.0.1" + resolved "https://registry.yarnpkg.com/vue-i18n/-/vue-i18n-10.0.1.tgz#5c67257f01dc9133513405985121fc86bbd2df84" + integrity sha512-SQVlSm/1S6AaG1wexvwq3ebXUrrkx75ZHD78UAs4/rYD/X3tsQxfm6ElpT4ZPegJQEgRtOJjGripqSrfqAENtg== dependencies: - "@intlify/core-base" "9.14.0" - "@intlify/shared" "9.14.0" + "@intlify/core-base" "10.0.1" + "@intlify/shared" "10.0.1" "@vue/devtools-api" "^6.5.0" vue-router@^4.0.0: From ee94de7a4c890b6459d38bd30152456b42d74c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=CC=8Cimon=20Macek?= Date: Thu, 19 Sep 2024 18:02:06 +0200 Subject: [PATCH 2/3] update command (to account for breaking change) --- src/components/__tests__/CountdownEvent.cy.js | 27 ++--------- src/components/__tests__/DrawerHeader.cy.js | 46 ++++++------------- src/i18n/en.toml | 2 +- test/cypress/support/commands.js | 13 ++++-- 4 files changed, 31 insertions(+), 57 deletions(-) diff --git a/src/components/__tests__/CountdownEvent.cy.js b/src/components/__tests__/CountdownEvent.cy.js index 67160c4b6..044f26304 100755 --- a/src/components/__tests__/CountdownEvent.cy.js +++ b/src/components/__tests__/CountdownEvent.cy.js @@ -23,28 +23,11 @@ describe('', () => { }); it('has translation for all strings', () => { - const translationKeyList = [ - 'index.countdown.title', - 'index.countdown.days', - 'index.countdown.hours', - 'index.countdown.minutes', - 'index.countdown.seconds', - ]; - - translationKeyList.forEach((translationKey) => { - const defaultEnglishString = i18n.global.t(translationKey, 'en'); - - const locales = i18n.global.availableLocales; - locales - .filter((locale) => locale !== 'en') - .forEach((locale) => { - i18n.global.locale = locale; - const translatedString = i18n.global.t(translationKey); - cy.wrap(translatedString) - .should('be.a', 'string') - .and('not.equal', defaultEnglishString); - }); - }); + cy.testLanguageStringsInContext( + ['title', 'days', 'hours', 'minutes', 'seconds'], + 'index.countdown', + i18n, + ); }); it('displays internationalized labels', () => { diff --git a/src/components/__tests__/DrawerHeader.cy.js b/src/components/__tests__/DrawerHeader.cy.js index 87320c9e7..b62a65cca 100644 --- a/src/components/__tests__/DrawerHeader.cy.js +++ b/src/components/__tests__/DrawerHeader.cy.js @@ -23,38 +23,22 @@ describe('', () => { }); it('has translation for all strings', () => { - const translationStrings = [ - 'titleStateDefault', - 'titleStateContact', - 'titleParticipants', - 'titleCoordinators', - 'titleGuide', - 'buttonGuide', - 'titleContact', - 'buttonContact', - 'titleLinks', - 'titleSocials', - ]; - - const translationKeyList = translationStrings.map( - (item) => `index.help.${item}`, + cy.testLanguageStringsInContext( + [ + 'titleStateDefault', + 'titleStateContact', + 'titleParticipants', + 'titleCoordinators', + 'titleGuide', + 'buttonGuide', + 'titleContact', + 'buttonContact', + 'titleLinks', + 'titleSocials', + ], + 'index.help', + i18n, ); - - translationKeyList.forEach((translationKey) => { - const defaultEnglishString = i18n.global.t(translationKey, 'en'); - - const locales = i18n.global.availableLocales; - locales - .filter((locale) => locale !== 'en') - .forEach((locale) => { - i18n.global.locale = locale; - const translatedString = i18n.global.t(translationKey); - - cy.wrap(translatedString) - .should('be.a', 'string') - .and('not.equal', defaultEnglishString); - }); - }); }); it('renders logo', () => { diff --git a/src/i18n/en.toml b/src/i18n/en.toml index 2896821de..5dd632bbd 100755 --- a/src/i18n/en.toml +++ b/src/i18n/en.toml @@ -154,7 +154,7 @@ labelCompanyShort = "Company" labelConfirmBillingDetails = "I confirm that the billing information above is correct" labelCoordinatorResponsibility = "I will arrange for the company to pay all or part of the entry fee for our employee team(s)." labelDonorEntryFee = "My organisation would like to support AutoMat and pay a charity entry fee of 500 CZK excluding VAT per person" -labelEmail = "E-mail" +labelEmail = "Email" labelFirstName = "First Name" labelGender = "Gender" labelHouseNumber = "House number" diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 65f5a3675..81f7a1af0 100644 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -51,14 +51,21 @@ Cypress.Commands.add( ); translationKeyList.forEach((translationKey) => { - const defaultEnglishString = i18n.global.t(translationKey, 'en'); + const defaultEnglishString = i18n.global.t( + translationKey, + {}, + { locale: 'en' }, + ); const locales = i18n.global.availableLocales; locales .filter((locale) => locale !== 'en') .forEach((locale) => { - i18n.global.locale = locale; - const translatedString = i18n.global.t(translationKey); + const translatedString = i18n.global.t( + translationKey, + {}, + { locale: locale }, + ); cy.wrap(translatedString) .should('be.a', 'string') From 84c7f67d1f73e65224ecb08d2a844a844e4ce7fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=CC=8Cimon=20Macek?= Date: Tue, 24 Sep 2024 09:05:56 +0200 Subject: [PATCH 3/3] fix command for e2e tests --- test/cypress/support/commands.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 81f7a1af0..a3fb41b0a 100644 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -61,6 +61,9 @@ Cypress.Commands.add( locales .filter((locale) => locale !== 'en') .forEach((locale) => { + // required for E2E tests to work + i18n.global.locale = locale; + const translatedString = i18n.global.t( translationKey, {},