Skip to content

Commit 82edccd

Browse files
prolonMarkLogicSanjeevani19
authored andcommitted
DHFPROD-9660: Fix e2e test pipeline graphSearchFacets
1 parent dd60ff8 commit 82edccd

File tree

1 file changed

+29
-14
lines changed
  • marklogic-data-hub/src/test/ml-modules/root/test/suites/data-hub/5/data-services/graph

1 file changed

+29
-14
lines changed

marklogic-data-hub/src/test/ml-modules/root/test/suites/data-hub/5/data-services/graph/graphSearchFacets.sjs

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,43 @@ const resultsTest = searchNodes(productQuery);
2929
let expectedNodeCount = graphUtils.supportsGraphConceptsSearch() ? 9 : 6;
3030
let expectedEdgeCount = graphUtils.supportsGraphConceptsSearch() ? 4 : 0;
3131

32+
let supportConcept = graphUtils.supportsGraphConceptsSearch();
33+
3234
let assertions = [
3335
test.assertEqual(expectedNodeCount, resultsTest.total),
3436
test.assertEqual(expectedNodeCount, resultsTest.nodes.length),
3537
test.assertEqual(expectedEdgeCount, resultsTest.edges.length)
3638
];
3739

38-
39-
resultsTest.nodes.forEach(node => {
4040
resultsTest.nodes.forEach(node => {
41-
if(node.id === "/content/product100.json") {
42-
assertions.push(test.assertTrue(node.hasRelationships, `Product 100 must have relationships flag in true. Result: ${xdmp.toJsonString(node)}`));
43-
}
44-
else if(node.id === "/content/product50.json") {
45-
assertions.push(test.assertFalse(node.hasRelationships, `Product 50 must have relationships flag in false. Result: ${xdmp.toJsonString(node)}`));
46-
}
47-
else if(node.id === "/content/product60.json") {
48-
assertions.push(test.assertFalse(node.hasRelationships, `Product 60 must have relationships flag in false. Result: ${xdmp.toJsonString(node)}`));
49-
}
50-
if (!node.isConcept) {
51-
assertions.push(test.assertTrue(node.docUri.includes("product")));
41+
if(supportConcept){
42+
if(node.id === "/content/product100.json") {
43+
assertions.push(test.assertTrue(node.hasRelationships, `Product 100 must have relationships flag in true. Result: ${xdmp.toJsonString(node)}`));
44+
}
45+
else if(node.id === "/content/product50.json") {
46+
assertions.push(test.assertFalse(node.hasRelationships, `Product 50 must have relationships flag in false. Result: ${xdmp.toJsonString(node)}`));
47+
}
48+
else if(node.id === "/content/product60.json") {
49+
assertions.push(test.assertFalse(node.hasRelationships, `Product 60 must have relationships flag in false. Result: ${xdmp.toJsonString(node)}`));
50+
}
51+
if (!node.isConcept) {
52+
assertions.push(test.assertTrue(node.docUri.includes("product")));
53+
}
54+
}else{
55+
if(node.id === "/content/product100.json") {
56+
assertions.push(test.assertTrue(node.hasRelationships, `Product 100 must have relationships flag in true. Result: ${xdmp.toJsonString(node)}`));
57+
}
58+
else if(node.id === "/content/product50.json") {
59+
assertions.push(test.assertTrue(node.hasRelationships, `Product 50 must have relationships flag in true. Result: ${xdmp.toJsonString(node)}`));
60+
}
61+
else if(node.id === "/content/product60.json") {
62+
assertions.push(test.assertTrue(node.hasRelationships, `Product 60 must have relationships flag in true. Result: ${xdmp.toJsonString(node)}`));
63+
}
64+
if (!node.isConcept) {
65+
assertions.push(test.assertTrue(node.docUri.includes("product")));
66+
}
5267
}
68+
5369
})
54-
})
5570

5671
assertions;

0 commit comments

Comments
 (0)