Skip to content
This repository was archived by the owner on Dec 9, 2023. It is now read-only.

Commit 0cf7321

Browse files
committed
run method to compute object assessment on a resource
1 parent 7f0847a commit 0cf7321

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

src/sensemaker_dna/sensemaker/neighbourhood.ts

+30-2
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export default () => {
194194
const createAssessmentEntryHash2: EntryHash = await callZomeAlice(
195195
"sensemaker",
196196
"create_assessment",
197-
createAssessment,
197+
createAssessment2,
198198
true
199199
);
200200
t.ok(createAssessmentEntryHash2);
@@ -265,9 +265,37 @@ export default () => {
265265
t.deepEqual(totalLikenessMethod, decode((createMethodReadOutput.entry as any).Present.entry) as any);
266266

267267
// compute objective dimension
268-
268+
const runMethodInput = {
269+
"resource_eh": createPostEntryHash,
270+
"method_eh": createMethodEntryHash,
271+
}
272+
273+
const runMethodOutput: EntryHash = await callZomeAlice(
274+
"sensemaker",
275+
"run_method",
276+
runMethodInput,
277+
true
278+
)
279+
t.ok(runMethodOutput);
280+
281+
await pause(100)
269282

270283

284+
const readObjectiveAssessmentOutput: Record = await callZomeBob(
285+
"sensemaker",
286+
"get_assessment",
287+
runMethodOutput,
288+
true
289+
);
290+
291+
const objectiveAssessment = {
292+
"value": { "Integer": createAssessment.value.Integer + createAssessment2.value.Integer },
293+
"dimension_eh": createObjectiveDimensionEntryHash,
294+
"subject_eh": createPostEntryHash,
295+
"maybe_input_dataset": null,
296+
}
297+
t.deepEqual(objectiveAssessment, decode((readObjectiveAssessmentOutput.entry as any).Present.entry) as any);
298+
271299
}
272300

273301
catch (e) {

0 commit comments

Comments
 (0)