Skip to content

Commit

Permalink
Added more unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sahalali committed Aug 5, 2024
1 parent a08b953 commit bef6c01
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/constant/recon-queries.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ WHERE
luc:entities ?entity .
PROPERTY_PLACE_HOLDER
FILTER (CONTAINS(STR(?entity),"kg.artsdata.ca/resource/K"))
FILTER (CONTAINS(STR(?entity),"kg.artsdata.ca/resource/"))
?entity luc:score ?score;
# a ?type_additional.
Expand Down
117 changes: 115 additions & 2 deletions src/service/recon/recon.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,118 @@ describe("Recon Service tests", () => {
],
expectedName: "Dance",
expectedCount: 1
},
{
description: "Reconcile a Place with Artsdata ID",
"queries": [
{
"type": "schema:Place",
"limit": 1,
"conditions": [
{
"matchType": "name",
"v": "K11-19"
}
]
}
],
expectedName: "Roy Thomson Hall",
expectedCount: 1
}, {
description: "Reconcile Place with Artsdata URI",
"queries": [
{
"type": "schema:Place",
"limit": 1,
"conditions": [
{
"matchType": "name",
"v": "http://kg.artsdata.ca/resource/K11-19"
}
]
}]
,
expectedName: "Roy Thomson Hall",
expectedCount: 1
}, {
description: "Reconcile Place with Name",
"queries": [
{
"type": "schema:Place",
"limit": 1,
"conditions": [
{
"matchType": "name",
"v": "Roy Thomson Hall"
}
]
}
],
expectedName: "Roy Thomson Hall",
expectedCount: 1
},
{
description: "Reconcile Place with Name",
"queries": [
{
"type": "schema:Place",
"limit": 1,
"conditions": [
{
"matchType": "name",
"v": "Roy Thomson Hall"
}
]
}
],
expectedName: "Roy Thomson Hall",
expectedCount: 1
}, {
description: "Reconcile Place with Name and Postal code",
"queries": [
{
"type": "schema:Place",
"limit": 1,
"conditions": [
{
"matchType": "name",
"v": "Roy Thomson"
}, {
"matchType": "property",
"v": "M5J 2H5",
"pid": "schema:address/schema:postalCode",
"required": true
}
]
}
],
expectedName: "Roy Thomson Hall",
expectedCount: 1
},
{
description: "Reconcile Place with Name and Street Address",
queries:
[
{
"type": "schema:Place",
"limit": 1,
"conditions": [
{
"matchType": "name",
"v": "Roy Thomson"
}, {
"matchType": "property",
"v": "60 Simcoe Street",
"pid": "schema:address/schema:streetAddress",
"required": true
}
]
}
],
expectedName: "Roy Thomson Hall",
expectedCount: 1
}

];

for (const test of testCases) {
Expand All @@ -246,7 +357,9 @@ describe("Recon Service tests", () => {
});
}

});
})
;


});
})
;

0 comments on commit bef6c01

Please sign in to comment.