Skip to content
Snippets Groups Projects
Commit 8367b81d authored by Muhammed-Ali Demir's avatar Muhammed-Ali Demir :speech_balloon:
Browse files

test: fixed test to fix pipe

parent 51ee3365
No related branches found
No related tags found
3 merge requests!10Refactor Test Resources,!6Adaptations for new DCC V3.2.1,!5Add tests
Pipeline #19243 passed
...@@ -3,13 +3,15 @@ ...@@ -3,13 +3,15 @@
* @xml ./tests/resources/GP_Temperature_Complete_DCC.xml * @xml ./tests/resources/GP_Temperature_Complete_DCC.xml
*/ */
import { select } from "../util"; import { select, toTextArr, toTextContentArr } from "../util";
import { DCCDocument } from "../../src"; import { DCCDocument } from "../../src";
const base = "//dcc:quantity[@refType='test_noQuantity']/dcc:noQuantity"; const base = "//dcc:quantity[@refType='test_noQuantity']/dcc:noQuantity";
const xpath = { const xpath = {
noQuantity: { noQuantity: {
name: `string(${base}/dcc:name)`, name: {
content: `string(${base}/dcc:name/dcc:content)`,
},
content: `string(${base}/dcc:content)`, content: `string(${base}/dcc:content)`,
file: { file: {
fileName: `string(${base}/dcc:file/dcc:fileName)`, fileName: `string(${base}/dcc:file/dcc:fileName)`,
...@@ -31,7 +33,9 @@ describe("noQuantity", () => { ...@@ -31,7 +33,9 @@ describe("noQuantity", () => {
}); });
test("should get correct name from XML", () => { test("should get correct name from XML", () => {
expect(result.data.quantity[0].noQuantity.name._text).toBe(select(xpath.noQuantity.name, dom)); const expected = <Element[]>select(xpath.noQuantity.name.content, dom);
expect(toTextArr(result.data.quantity[0].noQuantity.name.content)[0]).toBe(expected);
}); });
test("should get correct content from XML", () => { test("should get correct content from XML", () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment