Skip to content

Commit

Permalink
test(react-i18n): remove the verification of the content of templates
Browse files Browse the repository at this point in the history
  • Loading branch information
murdos committed Sep 25, 2024
1 parent f1b4166 commit 46e5ef4
Showing 1 changed file with 2 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,7 @@ void shouldBuildI18nModule() {
.containing(nodeDependency("i18next-http-backend"))
.containing(nodeDependency("react-i18next"))
.and()
.hasFile("src/main/webapp/app/i18n.ts")
.containing(
"""
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
i18n
.use(Backend)
.use(LanguageDetector)
.use(initReactI18next)
.init({
fallbackLng: 'en',
debug: false,
interpolation: {
escapeValue: false,
},
backend: {
loadPath: '../assets/locales/{{ lng }}/{{ ns }}.json',
},
});
export default i18n;
"""
)
.and()
.hasFiles("src/main/webapp/app/i18n.ts")
.hasFile("src/main/webapp/app/index.tsx")
.containing("import './i18n'")
.and()
Expand All @@ -68,24 +39,7 @@ void shouldBuildI18nModule() {
.containing("const { t } = useTranslation();")
.containing("{t('translationEnabled')}")
.and()
.hasFile("src/main/webapp/assets/locales/en/translation.json")
.containing(
"""
{
"translationEnabled": "Internationalization enabled"
}
"""
)
.and()
.hasFile("src/main/webapp/assets/locales/fr/translation.json")
.containing(
"""
{
"translationEnabled": "Internationalisation activée"
}
"""
)
.and()
.hasPrefixedFiles("src/main/webapp/assets/locales/", "en/translation.json", "fr/translation.json")
.hasFile("src/test/webapp/unit/common/primary/app/App.spec.tsx")
.containing("describe('App I18next', () => {");
}
Expand Down

0 comments on commit 46e5ef4

Please sign in to comment.