From 8a20b994cfe94faa1482656f33672c110b279ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 21 Jan 2022 21:09:01 +0100 Subject: [PATCH] Fix Cypress test --- webapp/plugins/i18n.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/plugins/i18n.js b/webapp/plugins/i18n.js index 76713de97..dbb31eb9e 100644 --- a/webapp/plugins/i18n.js +++ b/webapp/plugins/i18n.js @@ -22,13 +22,15 @@ export default ({ app, req, cookie, store }) => { if (process.server) return const newLocale = mutation.payload.locale + let isCookie = true let currentLocale = await app.$cookies.get(key) if (!currentLocale) { + isCookie = false currentLocale = navigator.language.split('-')[0] // get browser language } const isDifferent = newLocale !== currentLocale - if (!isDifferent) { + if (isCookie && !isDifferent) { // cookie has to be set, otherwise Cypress test does not work return }