locales.spec.ts 797 B

1234567891011121314151617181920212223242526
  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. })