locales.spec.ts 798 B

123456789101112131415161718192021222324252627
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { en } from '@formkit/i18n'
  3. import loadLocales from '../locales.ts'
  4. const staticLocale = loadLocales()
  5. const staticLocaleUI = staticLocale.ui
  6. const staticLocaleValidation = staticLocale.validation
  7. // This test should check if we have for all FormKit locale strings a local string
  8. // on our side.
  9. describe('locales', () => {
  10. it('check the ui strings', () => {
  11. Object.keys(en.ui).forEach((key) => {
  12. expect.soft(staticLocaleUI[key], `"${key}" is not defined`).toBeTruthy()
  13. })
  14. })
  15. it('check the validation strings', () => {
  16. Object.keys(en.validation).forEach((key) => {
  17. expect
  18. .soft(staticLocaleValidation[key], `"${key}" is not defined`)
  19. .toBeTruthy()
  20. })
  21. })
  22. })