forked from MapComplete/MapComplete
First steps to a real testing framework: first working version with mocha, chai and doctest-ts
This commit is contained in:
parent
edc366149b
commit
4f4fc650b1
42 changed files with 9032 additions and 9275 deletions
14
tests/UI/ValidatedTextFieldTranslations.ts
Normal file
14
tests/UI/ValidatedTextFieldTranslations.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import {describe} from 'mocha'
|
||||
import {expect} from 'chai'
|
||||
import Translations from "../../UI/i18n/Translations";
|
||||
import ValidatedTextField from "../../UI/Input/ValidatedTextField";
|
||||
|
||||
describe("ValidatedTextFields", () => {
|
||||
|
||||
it("All validated text fields should have a name and description", () => {
|
||||
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
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue