locales.spec.ts 814 B

123456789101112131415161718192021222324252627
  1. // Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. import { en } from '@formkit/i18n'
  3. import loadLocales from '../locales'
  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. if (!staticLocaleUI[key]) {
  13. console.log(`Missing form kit ui string "${key}".`)
  14. }
  15. expect(staticLocaleUI[key]).toBeTruthy()
  16. })
  17. })
  18. it('check the validation strings', () => {
  19. Object.keys(en.validation).forEach((key) => {
  20. expect(staticLocaleValidation[key]).toBeTruthy()
  21. })
  22. })
  23. })