forked from MapComplete/MapComplete
Fix some tests
This commit is contained in:
parent
bae64ab2f3
commit
ca91241c3b
3 changed files with 67 additions and 17 deletions
|
@ -2,6 +2,7 @@ import {describe} from 'mocha'
|
|||
import {expect} from 'chai'
|
||||
import Translations from "../../UI/i18n/Translations";
|
||||
import ValidatedTextField from "../../UI/Input/ValidatedTextField";
|
||||
import {fail} from "assert";
|
||||
|
||||
describe("ValidatedTextFields", () => {
|
||||
|
||||
|
@ -9,6 +10,8 @@ describe("ValidatedTextFields", () => {
|
|||
const ts = Translations.t.validation;
|
||||
const missingTranslations = Array.from(ValidatedTextField.allTypes.keys())
|
||||
.filter(key => ts[key] === undefined || ts[key].description === undefined)
|
||||
expect(missingTranslations, "These validated text fields don't have a type name defined in en.json. (Did you just add one? Run `npm run generate:translations`)").to.be.empty
|
||||
if(missingTranslations !== []){
|
||||
fail("undefined", "a `description` for "+missingTranslations.join(", ") , "These validated text fields don't have a type name defined in en.json. (Did you just add one? Run `npm run generate:translations`)")
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue