forked from MapComplete/MapComplete
refactoring: slight cleanup of tests
This commit is contained in:
parent
2e9b1016de
commit
f8d34648a0
28 changed files with 252 additions and 353 deletions
|
@ -1,20 +0,0 @@
|
|||
import { describe } from "mocha"
|
||||
import ValidatedTextField from "../../UI/Input/ValidatedTextField"
|
||||
import { fail } from "assert"
|
||||
import Translations from "../../UI/i18n/Translations"
|
||||
|
||||
describe("ValidatedTextFields", () => {
|
||||
it("should all have description in the translations", () => {
|
||||
const ts = Translations.t.validation
|
||||
const missingTranslations = Array.from(ValidatedTextField.allTypes.keys())
|
||||
.filter((key) => ts[key] === undefined || ts[key].description === undefined)
|
||||
.filter((key) => key !== "distance")
|
||||
if (missingTranslations.length > 0) {
|
||||
fail(
|
||||
"The validated text fields don't have a description defined in en.json for " +
|
||||
missingTranslations.join(", ") +
|
||||
". (Did you just add one? Run `npm run generate:translations`)"
|
||||
)
|
||||
}
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue