mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
tests are working again
This commit is contained in:
parent
c4440f50e3
commit
f7cae0359e
@ -21,12 +21,14 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
locales: locales,
|
||||
currentLanguage: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async setLocale(locale) {
|
||||
setLocale(locale) {
|
||||
this.$i18n.locale = locale
|
||||
this.$store.commit('language', this.$i18n.locale)
|
||||
this.currentLanguage = this.getLocaleObject(locale)
|
||||
localeChanged(locale)
|
||||
},
|
||||
async saveLocale(locale) {
|
||||
@ -52,9 +54,7 @@ export default {
|
||||
if (lang) return lang.split('-')[0]
|
||||
return lang
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
currentLanguage() {
|
||||
setCurrentLanguage() {
|
||||
let locale = this.$store.state.language || this.getNavigatorLanguage() || 'en'
|
||||
let object = this.getLocaleObject(locale)
|
||||
if (!object) {
|
||||
@ -62,8 +62,11 @@ export default {
|
||||
object = this.getLocaleObject(locale)
|
||||
}
|
||||
this.setLocale(locale)
|
||||
return object
|
||||
this.currentLanguage = object
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.setCurrentLanguage()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -12,9 +12,6 @@ describe('ContentFooter', () => {
|
||||
locale: 'en',
|
||||
},
|
||||
$t: jest.fn((t) => t),
|
||||
$store: {
|
||||
commit: jest.fn(),
|
||||
},
|
||||
}
|
||||
|
||||
const Wrapper = () => {
|
||||
|
||||
@ -44,6 +44,9 @@ describe('DashboardLayoutGdd', () => {
|
||||
|
||||
const store = new Vuex.Store({
|
||||
state,
|
||||
mutations: {
|
||||
language: jest.fn(),
|
||||
},
|
||||
})
|
||||
|
||||
const Wrapper = () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user