Skip to content
Snippets Groups Projects
Commit 90799b4f authored by Moritz Jordan's avatar Moritz Jordan
Browse files

Changes by loewe01

parent b695cb4b
No related branches found
No related tags found
3 merge requests!10Refactor Test Resources,!6Adaptations for new DCC V3.2.1,!5Add tests
Pipeline #18571 passed
This commit is part of merge request !5. Comments created here will be created in the context of that merge request.
...@@ -15,20 +15,20 @@ const xpath = { ...@@ -15,20 +15,20 @@ const xpath = {
}; };
describe("CoreDataType", () => { describe("CoreDataType", () => {
let dcc: DCCDocument, coreData: CoreDataType; let dcc: DCCDocument, coreData: CoreDataType, dom;
beforeEach(async () => { beforeEach(async () => {
({ dcc } = await xmlEnv.recreateEnv()); ({ dcc, dom } = await xmlEnv.recreateEnv());
coreData = dcc.digitalCalibrationCertificate.administrativeData.coreData; coreData = dcc.digitalCalibrationCertificate.administrativeData.coreData;
}); });
test("should get correct countryCodeISO3166_1 from XML", () => { 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", () => { test("should get correct usedLangCodeISO639_1 from XML", () => {
// get expected list from example 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)); expect(toTextArr(coreData.usedLangCodeISO639_1)).toEqual(toTextContentArr(expected));
}); });
...@@ -48,7 +48,7 @@ describe("CoreDataType", () => { ...@@ -48,7 +48,7 @@ describe("CoreDataType", () => {
}); });
test("should delete usedLangCodeISO639_1 correctly", () => { 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.assert(
fc.property(fc.constantFrom(...selection), (str) => { fc.property(fc.constantFrom(...selection), (str) => {
// get index and remove element from array // get index and remove element from array
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment