Skip to content
Snippets Groups Projects

test: added tests for reftype, id of reportAmendedSubstituted and item...

Merged Muhammed-Ali Demir requested to merge missing_tests_v3.2.1 into master
4 files
+ 39
12
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -6,13 +6,13 @@
@@ -6,13 +6,13 @@
import { select } from "../../util";
import { select } from "../../util";
import { CoreDataType, DCCDocument } from "../../../src";
import { CoreDataType, DCCDocument } from "../../../src";
const base = "/dcc:digitalCalibrationCertificate/dcc:administrativeData/dcc:coreData";
const base = "/dcc:digitalCalibrationCertificate/dcc:administrativeData/dcc:coreData/dcc:reportAmendedSubstituted";
const xpath = {
const xpath = {
coreData: {
reportAmendedSubstituted: {
reportAmendedSubstituted: {
typeOfChange: `string(${base}/dcc:typeOfChange)`,
typeOfChange: `string(${base}/dcc:reportAmendedSubstituted/dcc:typeOfChange)`,
replacedUniqueIdentifier: `string(${base}/dcc:replacedUniqueIdentifier)`,
replacedUniqueIdentifier: `string(${base}/dcc:reportAmendedSubstituted/dcc:replacedUniqueIdentifier)`,
refType: `string(${base}//@refType)`,
},
id: `string(${base}//@id)`,
},
},
};
};
@@ -25,12 +25,18 @@ describe("GP_Temperature_v3.2.1_DCC: CoreDataType", () => {
@@ -25,12 +25,18 @@ describe("GP_Temperature_v3.2.1_DCC: CoreDataType", () => {
});
});
test("should get correct reportAmendedSubstituted typeOfChange from XML", () => {
test("should get correct reportAmendedSubstituted typeOfChange from XML", () => {
expect(coreData.reportAmendedSubstituted.typeOfChange._text).toBe(select(xpath.coreData.reportAmendedSubstituted.typeOfChange, dom));
expect(coreData.reportAmendedSubstituted.typeOfChange._text).toBe(select(xpath.reportAmendedSubstituted.typeOfChange, dom));
});
});
test("should get correct reportAmendedSubstituted replacedUniqueIdentifier from XML", () => {
test("should get correct reportAmendedSubstituted replacedUniqueIdentifier from XML", () => {
expect(coreData.reportAmendedSubstituted.replacedUniqueIdentifier._text).toBe(
expect(coreData.reportAmendedSubstituted.replacedUniqueIdentifier._text).toBe(select(xpath.reportAmendedSubstituted.replacedUniqueIdentifier, dom));
select(xpath.coreData.reportAmendedSubstituted.replacedUniqueIdentifier, dom),
});
);
 
test("should get correct reportAmendedSubstituted refType from XML", () => {
 
expect(coreData.reportAmendedSubstituted._attr.refType).toBe(select(xpath.reportAmendedSubstituted.refType, dom));
 
});
 
 
test("should get correct reportAmendedSubstituted id from XML", () => {
 
expect(coreData.reportAmendedSubstituted._attr.id).toBe(select(xpath.reportAmendedSubstituted.id, dom));
});
});
});
});
Loading