Skip to content
Snippets Groups Projects

Add tests

Merged Jan Loewe requested to merge feat-jest-tests into master
1 file
+ 5
5
Compare changes
  • Side-by-side
  • Inline
@@ -15,20 +15,20 @@ const xpath = {
};
describe("CoreDataType", () => {
let dcc: DCCDocument, coreData: CoreDataType;
let dcc: DCCDocument, coreData: CoreDataType, dom;
beforeEach(async () => {
({ dcc } = await xmlEnv.recreateEnv());
({ dcc, dom } = await xmlEnv.recreateEnv());
coreData = dcc.digitalCalibrationCertificate.administrativeData.coreData;
});
test("should get correct countryCodeISO3166_1 from XML", () => {
expect(coreData.countryCodeISO3166_1._text).toBe(select(xpath.countryCodeISO3166_1, dcc));
expect(coreData.countryCodeISO3166_1._text).toBe(select(xpath.countryCodeISO3166_1, dom));
});
test("should get correct usedLangCodeISO639_1 from XML", () => {
// get expected list from example xml
const expected = <Element[]>select(xpath.usedLangCodeISO639_1, dcc);
const expected = <Element[]>select(xpath.usedLangCodeISO639_1, dom);
expect(toTextArr(coreData.usedLangCodeISO639_1)).toEqual(toTextContentArr(expected));
});
@@ -48,7 +48,7 @@ describe("CoreDataType", () => {
});
test("should delete usedLangCodeISO639_1 correctly", () => {
const selection = toTextContentArr(<Element[]>select(xpath.usedLangCodeISO639_1, dcc));
const selection = toTextContentArr(<Element[]>select(xpath.usedLangCodeISO639_1, dom));
fc.assert(
fc.property(fc.constantFrom(...selection), (str) => {
// get index and remove element from array
Loading